I have a class A:
class A:
def __new__(*args, **kwargs)
def __init__(a1, a2)
Now I'd like to pass in a new argument a3
to create factory
class A:
def __new__(*args, **kwargs):
# Do sth with a3
def __init__(a1, a2)
So here a3
is only used in __new__
, but I realized I must pass in a3
into __init__
first to get it work, so that I need to modify __init__
into def __init__(a1, a2, a3)
or def __init__(a1, a2, **kwargs)
. It's weird that I pass a3
but never use it in __init__
So basically here is there anyway I could just trigger __new__
without changing __init__
?