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/056666.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.4Jim Jewett jimjjewett at gmail.com
Thu Sep 22 15:41:32 CEST 2005
Greg Ewing wrote:

> But if the docs don't mention anything about true or
> false values for some particular type, one tends to
> assume that all values are true, as is the default
> for user-defined classes.

The tutorials and such stress that python doesn't
typically care about a specific "True" or "False"; the
normal distinction is between "empty" and "not empty".

0, None, (), [], {} all come out as false.

"Is there anything left?" is a pretty analogy for iterators,
particularly since the examples tend to start with list
or file iterators.

x = [] or iter([]) or "nope" does just what *I* expect.

If you want to change it back, so be it, but it will break
code that way too; please at least make big notes in
the documentation.

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