cpython/Doc/whatsnew
Tim Hoffmann fdb3ef8c0f
gh-82012: Deprecate bitwise inversion (~) of bool (#103487)
The bitwise inversion operator on bool returns the bitwise inversion of the
underlying int value; i.e. `~True == -2` such that `bool(~True) == True`.

It's a common pitfall that users mistake `~` as negation operator and actually
want `not`. Supporting `~` is an artifact of bool inheriting from int. Since there
is no real use-case for the current behavior, let's deprecate `~` on bool and
later raise an error. This removes a potential source errors for users.

Full reasoning: https://github.com/python/cpython/issues/82012#issuecomment-1258705971

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-05-03 00:00:42 -07:00
..
2.0.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
2.1.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
2.2.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
2.3.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
2.4.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
2.5.rst gh-93738: Disallow pre-v3 syntax in the C domain (#97962) 2022-10-06 10:11:37 -07:00
2.6.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
2.7.rst GH-103484: Fix broken links reported by linkcheck (#103608) 2023-04-22 08:24:47 -06:00
3.0.rst Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) 2022-07-05 11:16:10 +02:00
3.1.rst gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961) 2022-09-24 14:38:53 +03:00
3.2.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
3.3.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
3.4.rst gh-96959: Update more HTTP links (GH-97536) 2022-09-27 14:08:11 +03:00
3.5.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
3.6.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
3.7.rst Docs: Fix backtick errors found by sphinx-lint (#97998) 2022-10-06 18:01:30 -07:00
3.8.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
3.9.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
3.10.rst gh-100160: Restore and deprecate implicit creation of an event loop (GH-100410) 2023-01-13 14:40:29 +02:00
3.11.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
3.12.rst gh-82012: Deprecate bitwise inversion (~) of bool (#103487) 2023-05-03 00:00:42 -07:00
changelog.rst Include additional changes to support blurbified NEWS (#3340) 2017-09-05 00:46:18 -07:00
index.rst Fix What's New for 3.12 (GH-92482) 2022-05-08 18:23:08 +03:00