Rule request
"WPS600 Forbid subclassing lowercase builtins" should allow the following
class PizzaToppings(str, Enum):
MARGHERITA = "MARGHERITA"
MARINARA = "MARINARA"
Thesis
Enums are a bit akwkard in Python. The class PizzaToppings(str, Enum):... construct allows to create what is basically a string equivalent of IntEnum, so that one can do
if current_topping == PizzaToppings.MARINARA:
...
Reasoning
It seems beneficial, farily widely used, and has no negative side effects I can think of. No reason to ban it.
Thanks.
Rule request
"WPS600 Forbid subclassing lowercase builtins" should allow the following
Thesis
Enums are a bit akwkard in Python. The
class PizzaToppings(str, Enum):...construct allows to create what is basically a string equivalent of IntEnum, so that one can doReasoning
It seems beneficial, farily widely used, and has no negative side effects I can think of. No reason to ban it.
Thanks.