122982 -
For most developers, this is rarely the intended result. Usually, someone using ~ on a boolean actually wants the logical NOT ( not True ), which correctly returns False . Because of this common point of confusion, the Python steering committee decided to deprecate bitwise inversion on booleans to encourage clearer coding practices. What’s New in Issue #122982?
If you have ever accidentally used the bitwise inversion operator ( ~ ) on a Python boolean, you might have noticed it behaves in a way that is technically correct but logically confusing. As Python continues to refine its syntax for better clarity, Issue #122982 marks a small but important step in how the language handles these edge cases. The Problem: Why ~True Isn't False 122982
Keep an eye on your console for those DeprecationWarnings —they are there to help you stay ahead of the curve! For most developers, this is rarely the intended result
