### Feature request Example set of constants that would fit into an enum really well: https://pillow.readthedocs.io/en/stable/_modules/PIL/Image.html#Image.transpose That could be refactored to: ```python class TransposeType(enum.IntEnum): FLIP_LEFT_RIGHT = 0 FLIP_TOP_BOTTOM = 1 [etc] FLIP_LEFT_RIGHT = TransposeType.FLIP_LEFT_RIGHT FLIP_TOP_BOTTOM = TransposeType.FLIP_TOP_BOTTOM [etc] ``` Advantages: - easier to check if a value is as expected (check type of enum value) Disadvantages: - have to research if any existing usages can break Smaller factors: - (some) refactoring required - (negligible) performance overhead
Activity
kero-ly commentedon Dec 8, 2021
I think it's designed for casting int value from python to cpp conveniently, and validate it cpp :D
radarhere commentedon Jan 11, 2022
I've created #5954 to resolve this. See what you think.
melonmouse commentedon Jan 11, 2022
Awesome work radarhere, left a review there!
[-]Feature request: change from constants to enums[/-][+]Change from constants to enums[/+]radarhere commentedon Oct 25, 2022
Be aware that #6684 has been proposed, which would revert the changes for this.