Note: I corrected the spelling of Original in this answer
It appears that the problem is that when your Modified object is being instantiated and super is called, its being called like: super(Original, self) since those are the default arguments for super. Since Original is not a superclass of Modified (check isinstance(m, Original)), python is not allowing you to call super in that way.
The following code does something similar to yours but better illustrates the problem.
class Base():
def __init__(self):
print("Base init")
class Original(Base):
def __init__(self):
super().__init__()
print("Orginal init")
class Modified(Base):
def __init__(self):
super(Original, self).__init__() # illegal
Modified.__name__ == Original.__name__
m = Modified() # raises same Exception that your your code does
Adding Original to the bases of Modified will make it work:
Modified = type(Original.__name__, (Original,) + Original.__bases__, dict(Original.__dict__))
Edit:
Per the comments, the above suggestion can be simplified since all the methods contained within Original will be included in Modified without needing to pass the dict in the type call:
Modified = type(Original.__name__, (Original,), {})
and going one step further, if you don't want Modified to be a subclass of Original, you could simply make Modified a copy of Original and then add attributes the same as you do in your example:
from copy import deepcopy
Modified = deepcopy(Original)
Modified.f = lambda self: print("f")
m = Modified()
Looking at this answer, it appears that you cannot use deepcopy to copy classes, and given that you have that super() call in your Original.__init__ method, Modified be a subclass of Original (unless you also modify the __init__ method in your Modified class after it's been "copied").