3 ms·
I believe the original PEP [1] answers almost all questions. The only option not covered would be probably an "optional" type, but it is even easier to answer:
by lifthrasiir 3y ago
I believe the original PEP [1] answers almost all questions. The only option not covered would be probably an "optional" type, but it is even easier to answer: any such type has to be heap-allocated in the Python memory model, so a mere iteration could've caused a lot of redundant memory allocations.
[1] https://peps.python.org/pep-0234/#rationale https://peps.python.org/pep-0234/#rationale