"Guido van Rossum" <guido at python.org> wrote in message news:ca471dc205092017071f2eb1e8 at mail.gmail.com... >> [Fred] >> > think iterators shouldn't have length at all: >> > they're *not* containers and shouldn't act that way. >> >> Some iterators can usefully report their length with the invariant: >> len(it) == len(list(it)). > >I still consider this an erroneous hypergeneralization of the concept >of iterators. Iterators should be pure iterators and not also act as >containers. Which other object type implements __len__ but not >__getitem__? Too late, and probably irrelevant by now; the answer though is set([1,2,3])
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4