[prev in list] [next in list] [prev in thread] [next in thread]
List: python-dev
Subject: [Python-Dev] Wither PEP 335 (Overloadable Boolean Operators)?
From: "Jim Jewett" <jimjjewett () gmail ! com>
Date: 2007-05-25 19:33:28
Message-ID: fb6fbf560705251233k55d5e193o54969f24d864e0c6 () mail ! gmail ! com
[Download RAW message or body]
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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic