◐ Shell
clean mode source ↗

[3.11] gh-93820: Fix copy() regression in enum.Flag (GH-93876) by miss-islington · Pull Request #93886 · python/cpython

pythonGH-26658 introduced a regression in copy / pickle protocol for combined
`enum.Flag`s. `copy.copy(re.A | re.I)` would fail with
`AttributeError: ASCII|IGNORECASE`.

`enum.Flag` now has a `__reduce_ex__()` method that reduces flags by
combined value, not by combined name.
(cherry picked from commit 05b32c1)

Co-authored-by: Christian Heimes <christian@python.org>