[Python-ideas] Consider making enumerate a sequence if its argument is a sequence

Random832 random832 at fastmail.com
Thu Oct 1 06:13:50 CEST 2015


Andrew Barnert via Python-ideas
<python-ideas at python.org> writes:
> I think the docs used to use the word "virtual" as a more specific
> term than "lazy": a view onto an object that conceptually exists but
> doesn't actually exist is "virtual" (like range, which is a view into
> the infinite set of integers), but a view into a real object isn't
> (like dict_keys, which has a reference to an actual dict), nor is
> something that isn't conceptually view-like at all (like a RNG
> iterator), even though they're all "lazy".

If either "lazy" or "virtual" means that the contained objects don't
exist as python objects until they are accessed, doesn't this extend to
strings and arrays (and byte strings, byte arrays, and memory views)?



More information about the Python-ideas mailing list