On Fri, Jan 22, 2021 at 11:48 AM Neil Girdhar <[email protected]> wrote: > If enumerate(some_sequence) returns a sequence view, iterating over > that sequence view does not advance it—just like how DictViews are not > altered by iteration. Same thing if reversed(some_sequence) returns a > sequence view.
Then that's backward incompatible with current behaviour, and cannot be done just as "it's a sequence so return a sequence view". Hence the suggestion of a parameter to control this - or, my preferred way: a "seqview" module from which you can import a sequence-view-only version of various iterator functions. ChrisA _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/4HTQLRKKDAV7YE4JCOJPSUBIYUWIKYSI/ Code of Conduct: http://python.org/psf/codeofconduct/
