A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-February/042561.html below:

[Python-Dev] bool does not want to be subclassed?

[Python-Dev] bool does not want to be subclassed? [Python-Dev] bool does not want to be subclassed?Guido van Rossum guido at python.org
Fri Feb 13 18:59:48 EST 2004
> So a different question...  Can it be relied upon that two expressions
> which both evaluate to False both return the same object?  That is, is
> it incorrect for a Python interpreter not to do this?  I find this in
> the Python Reference Manual: "for immutable types, operations that
> compute new values may actually return a reference to any existing
> object with the same type and value" (note the "may").  Are bool and
> NoneType the only types for which this is reliably the case?

Among immutable built-in types, these plus Ellipsis are the only ones.
The language doesn't guarantee such a thing for numbers other than
bool, strings, unicode or tuples.

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