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/2007-August/074086.html below:

[Python-Dev] make iter() return an empty iterator?

[Python-Dev] make iter() return an empty iterator? [Python-Dev] make iter() return an empty iterator?Guido van Rossum guido at python.org
Fri Aug 3 19:07:24 CEST 2007
On 8/3/07, Steve Holden <steve at holdenweb.com> wrote:
> Kevin Jacobs <jacobs at bioinformed.com> wrote:
> > On 8/3/07, *Facundo Batista* <facundobatista at gmail.com
> > <mailto:facundobatista at gmail.com>> wrote:
> >
> >     2007/8/3, Andrew Bennetts <andrew-pythondev at puzzling.org
> >     <mailto:andrew-pythondev at puzzling.org>>:
> >
> >      > I don't really think there's much reason to make "iter()"
> >     work.  As you say,
> >
> >     What bad thing could happen if we make iter() work? If nothing, we
> >     should ask ourselves: which is the more intuitive behaviour to expect
> >     of iter()? To raise an exception or to return an empty iterator?
> >
> >     I'm +0 for the latter.
> >
> >
> > -1.  I'm a heavy user of iterators on finite and infinite streams and,
> > for me, iter() is an error that I do not want to paper over.  The
> > alternate logic implies, e.g ., len() should return 0.
> >
> -1 here too. iter() should have an argument just like sum() and len().

Amen.

-- 
--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