I have just discovered a strange behaviour of arguments of init while subclkassing in python. Having a simple code :
class my_frset (frozenset):
def __init__(self, st, inst):
super().__init__(st)
self.inst = inst
As i try to init an instance like :
a = my_frset({1,2,3} , 4)
i got an exception:
a = my_frset({1,2,3} , 4)
TypeError: my_frset expected at most 1 arguments, got 2
So my_frset wants to have 1 argument, But if i do like :
a = my_frset({1,2,3})
TypeError: __init__() missing 1 required positional argument: 'inst'
So it does not want to have either 1 not 2 argument, what is going on there ?