A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-September/056654.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.4Raymond Hettinger raymond.hettinger at verizon.net
Thu Sep 22 07:12:10 CEST 2005
[Guido]
> I strongly feel that this needs to be corrected in 2.5.  Iterators
> should have neither __len__ nor __nonzero__. 

Right.  I'll get it fixed-up.


[Terry Reedy]
> I presume there were two reasons: internal efficiency of 
> preallocations
> (list(some_it) for example)

[Guido]
> This could have been implemented without making the 
> implementation details public.

I see a way to do that by renaming the __len__ method to some private
name for internal use.  This would preserve the performance gains while
still restoring the public API.



Raymond

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