I want to write a function creating dynamic subclass. For example:
def get_class(num):
...
...
return _class
This function accepts an integer num and then constructs such a class
class Test(BaseClass):
attr_1 = 1
attr_2 = 1
...
attr_num = 1
and return it.
I wonder whether this is possible WITHOUT writing a metaclass.
get_class()return one of several predetermined classes, or an instance of one, or does it actually create entirely new types?