[Python-ideas] [Python-ideos] Dedicated overloadable boolean operators

Chris Angelico rosuav at gmail.com
Mon Nov 23 19:08:25 EST 2015


On Tue, Nov 24, 2015 at 10:49 AM, Jelte Fennema <me at jeltef.nl> wrote:
> As for the PEP, I have no problem writing one if this is accepted as a
> useful addition. Also any suggestions and critiques are very welcome of
> course.

I think it's reasonable, except for the potential confusion of having
*three* "and" operators. The one with the word is never going to
change - its semantics demand that it not be overridable. When should
you use & and when &&? Judging by how @ has gone, I think the answer
will be simple: "Always use &, unless the docs for some third-party
library say to use &&", in which case I think it should be okay.

ChrisA


More information about the Python-ideas mailing list