This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients mark.dickinson, rhettinger, serhiy.storchaka, tim.peters, tomerv
Date 2019-08-12.20:53:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565643225.11.0.361531125523.issue37831@roundup.psfhosted.org>
In-reply-to
Content
I don't agree that "~" doesn't "work".  If people are reading it as "not", they're in error.  The Python docs say ~x

means

    the bits of x inverted

and that's what it does.  There's no sense it which it was _intended_ to be logical negation, no more in Python than in C (C has the distinct unary prefix "!" operator for truthiness negation, and, as you note, Python has "not").

It's educational ;-) to learn how analogies between ints and bools can break down.  For logical negation in the sense they want here, it's not "~x" they want but "~x & 1" - that is, if someone insists on using an inappropriate operator.
History
Date User Action Args
2019-08-12 20:53:45tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, tomerv
2019-08-12 20:53:45tim.peterssetmessageid: <1565643225.11.0.361531125523.issue37831@roundup.psfhosted.org>
2019-08-12 20:53:45tim.peterslinkissue37831 messages
2019-08-12 20:53:44tim.peterscreate