Python 3 super and metaprogramming
问题 I'm trying to duplicate and then modify a class programmatically but I'm running into problems with python 3's magic super for example the following class Base(): def __init__(self): print("Base init") class Orginal(Base): def __init__(self): super().__init__() print("Orginal init") Modified = type(Orginal.__name__, Orginal.__bases__, dict(Orginal.__dict__)) Modified.f = lambda self: print("f") m = Modified() raises TypeError: super(type, obj): obj must be an instance or subtype of type So I