1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
from inspect import Parameter, Signature class Foo: pass class Bar: def __init__(self, x, y): pass class Baz: def __new__(cls, x, y): pass class Qux: __signature__ = Signature(parameters=[Parameter('foo', Parameter.POSITIONAL_OR_KEYWORD), Parameter('bar', Parameter.POSITIONAL_OR_KEYWORD)]) def __init__(self, x, y): pass