def get():
return 'You got got'
d = {'get': get}
# I basically want to go from ^ that dictionary to the following class
class Dynamic(ParentClass):
@staticmethod
def get():
return 'You got got'
# The only way I can get to work currently is a pretty hacky wrapper function. Am I missing something obvious?
def _wraps_class(methods):
class Dynamic(ParentClass):
pass
for method, method_fn in methods.items():
setattr(Dynamic, method, staticmethod(method_fn))