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/2002-March/020875.html below:

[Python-Dev] For review: PEP 285: Adding a bool type

[Python-Dev] For review: PEP 285: Adding a bool type [Python-Dev] For review: PEP 285: Adding a bool typeSamuele Pedroni pedroni@inf.ethz.ch
Sun, 10 Mar 2002 16:06:19 +0100
From: Samuele Pedroni <pedroni@inf.ethz.ch>
> 
> > 
> > > Damn, you're right.  I'll patch doctest to special-case the snot out of
> > > those specific strings <wink>.  In the meantime,
> > > 
> > > def ibool(e):
> > >     return e and 1 or 0
> > >     # or "return operator.truth(e)"
> > > 
> > > will work across all Pythons forever, or back to 1.4 if you use
> > > operator.truth to avoid offending yourself <wink>.
> 
> Btw given that probably operator.truth() will
> become a synonym of bool() the "# or" comment
> does not apply.
> 

Btw, as far as I understand ibool can be spelled just as +

>>> +(1>0)
1

regards, Samuele Pedroni.




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