122982 -
Originally, the plan was to move toward a full error or a more aggressive deprecation schedule. However, Issue #122982 proposes . This extension serves a few key purposes:
is_active = True status = ~is_active # Returns -2, triggers warning Use code with caution. Copied to clipboard is_active = True status = not is_active # Returns False Use code with caution. Copied to clipboard Conclusion 122982
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 Originally, the plan was to move toward a
Python Development Update: Extending the Deprecation Warning for ~bool (Issue #122982) 122982