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/2004-February/042536.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?Aahz aahz at pythoncraft.com
Thu Feb 12 14:50:50 EST 2004
On Thu, Feb 12, 2004, François Pinard wrote:
>
> Hi, people.  I just noticed this:
> 
> >>> class booleen(bool):
> ...   def __repr__(self):
> ...     if self:
> ...         return "Vrai"
> ...     return "Faux"
> ... 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: type 'bool' is not an acceptable base type
> >>> 

Just to bolster Francois's case, I ran into this precise use case a week
ago myself (where I wanted a bool but needed to change the output
string).  Didn't bother complaining about it, though.  ;-)
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Argue for your limitations, and sure enough they're yours."  --Richard Bach

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