My new AI coaching app Purpose is here. Try It Free

122982 Apr 2026

It allows more time for the community to discuss if there are specific edge cases where bitwise inversion on bool remains necessary. How to Prepare Your Code

Python’s evolution is often about making the "obvious" way to do things the only way to do things. While Issue #122982 might seem like a minor administrative tweak in the CPython GitHub, it reflects the core philosophy of maintaining a stable, readable, and developer-friendly language. 122982

Rapidly turning a warning into a hard error can break environments. A longer warning period ensures developers see the notice without their builds immediately failing. It allows more time for the community to

Keep an eye on your console for those DeprecationWarnings —they are there to help you stay ahead of the curve! Rapidly turning a warning into a hard error

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?

In Python, booleans are a subclass of integers. When you apply the bitwise NOT operator ( ~ ) to a boolean: ~True (which is ~1 ) evaluates to -2 . ~False (which is ~0 ) evaluates to -1 .

Large codebases and libraries need time to refactor code that might be legacy or automatically generated.