-
Notifications
You must be signed in to change notification settings - Fork 1.5k
using StrEnum instead of Enum #4351
Description
Is your feature request related to a problem? Please describe.
StrEnum (new in py3.11 https://docs.python.org/3.11/library/enum.html#enum.StrEnum) "is the same as Enum, but its members are also strings and can be used in most of the same places that a string can be used."
this is a feature request for incorporating this class which will hopefully simplify the codebase in many places such as
MONAI/monai/transforms/croppad/array.py
Line 94 in eb60b9c
| mode: Union[NumpyPadMode, PytorchPadMode, str] = NumpyPadMode.CONSTANT, |
however StrEnum is not available for other versions of python that monai supports, some customized class should be introduced. see also the discussion https://discuss.python.org/t/built-in-strenum/4192