-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed as not planned
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
I was doing some testing with doctest for my python library, I noticed that the CI was failing for python3.10. The issue is that the __repr__ for IntFlag (but I assume for Flag in general) breaks backward compatibility due to printing the flags in reverse order.
from enum import IntFlag
class Flag(IntFlag):
A = 1 << 0
B = 1 << 1
C = 1 << 2
print(f"{Flag.B | Flag.C!r}")
# output in python 3.10:
# <Flag.C|B: 6>
# output in python 3.11 onwards
# <Flag.B|C: 6>CPython versions tested on:
3.10, 3.11, 3.12, 3.13
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error