-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
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:
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