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
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com