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/2007-May/073467.html below:

[Python-Dev] Wither PEP 335 (Overloadable Boolean Operators)?

[Python-Dev] Wither PEP 335 (Overloadable Boolean Operators)?Jim Jewett jimjjewett at gmail.com
Fri May 25 21:33:28 CEST 2007
Greg,

If you do update this PEP, please update the __not__ portion as well,
at least regarding possible return values.

It currently says that __not__ can return NotImplemented, which falls
back to the current semantics.   (Why?  to override an explicit
__not__?  Then why not just put the current semantics on __object__,
and override by calling that directly?)

It does not yet say what will happen for objects that return something
else outside of {True, False}, such as

    class AntiBool(object):
        def __not__(self):  return self

Is that OK, because "not not X" should now be spelled "bool(x)", and
you haven't allowed the overriding of __bool__?  (And, if so, how does
that work Py3K?)

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