TypeError: metaclass "takes no arguments"

Why do we get an error for the following code:

class StateMeta:
    def __call__(*args, **kwargs):
    # end __call__
# end StateMeta

class State(metaclass=StateMeta):


Traceback (most recent call last):
  File "D:/FILE_MGMT_PYTHON/tempHSHDFHS).py", line 7, in <module>
    class State(metaclass=StateMeta):
TypeError: StateMeta() takes no arguments

Read more here: https://stackoverflow.com/questions/58580274/typeerror-metaclass-takes-no-arguments

Content Attribution

This content was originally published by Samuel Muldoon at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: