A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-October/057481.html below:

[Python-Dev] bool(iter([])) changed between 2.3 and 2.4

[Python-Dev] bool(iter([])) changed between 2.3 and 2.4 [Python-Dev] bool(iter([])) changed between 2.3 and 2.4Christos Georgiou tzot at mediconsa.com
Thu Oct 20 23:51:10 CEST 2005
"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]) 


More information about the Python-Dev mailing list

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