The code
import enum
class a(enum):
Foo = 1
Bar = 1
will raise the exception TypeError: module() takes at most 2 arguments (3 given)
.
This doesn’t tell me what I did wrong. Instead, it tells something about a callable module()
which doesn’t seem to exist.
Instead, I suggest that this should raise an exception like Type Error: Cannot subclass module
because that tells people accidentally writing enum
instead of enum.Enum
what they did wrong so that they can find their mistake easily.