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/056649.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.4Guido van Rossum guido at python.org
Thu Sep 22 05:14:12 CEST 2005
On 9/21/05, Raymond Hettinger <raymond.hettinger at verizon.net> wrote:
> [Guido van Rossum]
> > Could you at least admit that this was an oversight and not try to
> > pretend it was intentional breakage?
>
> Absolutely.  I completely missed this one.

Thanks; spoken like a man.

I strongly feel that this needs to be corrected in 2.5.  Iterators
should have neither __len__ nor __nonzero__. I see mostly agreement
that this is a misfeature. We don't really want to start writing code
like this:

  while it:
      x = it.next()
      ...process x...

when we can already write it like this:

  for x in it:
      ...process x...

do we?

Keeping a special API to allow a more efficient implementation of
__reversed__ is fine.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
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