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/074077.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?Ron Adam rrr at ronadam.com
Fri Aug 3 12:11:25 CEST 2007
Georg Brandl wrote:
> Sure, you could use ``iter(())`` or ``iter([])``, but for consistency's sake
> wouldn't it make sense for ``iter()`` to return an empty iterator, as ``str()``
> returns an empty string etc.?
> 
> Georg

There is a difference.

 >>> type(iter)
<type 'builtin_function_or_method'>
 >>> type(str)
<type 'type'>
 >>> type(int)
<type 'type'>
 >>> type(list)
<type 'type'>

Cheers,
    Ron

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