I would like to create a simple wrapper class for frozenset
that changes the constructor arguments. Here is what I have come up with (as I would do it in Java) :
class Edge(frozenset):
def __init__(self, a, b):
frozenset.__init__(self, {a, b})
I would like to have Edge(0,1)
createfrozenset({0,1})
.
However, I get this error:
>>>Edge(0,1)
TypeError: Edge expected at most 1 arguments, got 2