]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-150817: Speed up Flag bitwise operations (GH-150824)
authorBernát Gábor <gaborjbernat@gmail.com>
Thu, 4 Jun 2026 19:58:20 +0000 (12:58 -0700)
committerGitHub <noreply@github.com>
Thu, 4 Jun 2026 19:58:20 +0000 (12:58 -0700)
commitd4a8066c82a9b71c26d98c285db233fe2ef07517
tree2196d07ad6875f6fd3ec32be3d06c4af06dbf0cf
parente833f57383546a02d61028aa87194aa65d5a92a3
gh-150817: Speed up Flag bitwise operations (GH-150824)

Flag.__or__, __and__ and __xor__ walked both operands on every call to reject
None values. Run that scan only when one of the operand values is actually
None, so valid combinations skip it. The TypeError and its message are
unchanged for the invalid cases.
Lib/enum.py
Misc/NEWS.d/next/Library/2026-06-02-15-44-57.gh-issue-150817.lpFCh0.rst [new file with mode: 0644]