A
abcd
I wanted to extend tuple but ran into a problem. Here is what I
thought would work
class MyTuple(tuple):
def __init__(self, *args):
tuple.__init__(self, args)
x = MyTuple(1,2,3,4)
That gives me...
TypeError: tuple() takes at most 1 argument (4 given).
However, this call works:
x = MyTuple((1,2,3,4))
I am perplexed only because "args" is a tuple by the definition of
*args. Anyone?
thought would work
class MyTuple(tuple):
def __init__(self, *args):
tuple.__init__(self, args)
x = MyTuple(1,2,3,4)
That gives me...
TypeError: tuple() takes at most 1 argument (4 given).
However, this call works:
x = MyTuple((1,2,3,4))
I am perplexed only because "args" is a tuple by the definition of
*args. Anyone?