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-September/048798.html below:

[Python-Dev] ANN: PEP 335: Overloadable Boolean Operators

[Python-Dev] ANN: PEP 335: Overloadable Boolean Operators [Python-Dev] ANN: PEP 335: Overloadable Boolean Operators"Martin v. Löwis" martin at v.loewis.de
Fri Sep 10 22:59:06 CEST 2004
Phillip J. Eby wrote:
>> I like the PEP with 'and' and 'or', but isn't the 'not' special method
>> essentially the inverse of __nonzero__?
> 
> 
> There isn't such a method currently.  

Did you mean to say that there is currently no method named __nonzero__?
This is not true:

 >>> class X:
...   def __nonzero__(self):
...     print "Called"
...     return 13
...
 >>> not X()
Called
False

Regards,
Martin
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