Re: Calling parent constructor with different argument list

2009-08-14 Thread Gabriel Genellina
En Fri, 14 Aug 2009 19:24:26 -0300, pinkisntwell escribió: class Vertex(tuple): pass class Positioned_Vertex(Vertex): def __init__(self, a, b): Vertex.__init__(a) a=Positioned_Vertex((0,0,0), 1) This gives: TypeError: tuple() takes at most 1 argument (2 given) It looks l

Re: Calling parent constructor with different argument list

2009-08-14 Thread Mark Lawrence
pinkisntwell wrote: class Vertex(tuple): pass class Positioned_Vertex(Vertex): def __init__(self, a, b): def __init__(self, a): # just take out b Vertex.__init__(a) a=Positioned_Vertex((0,0,0), 1) a=Positioned_Vertex( ( (0,0,0), 1) ) # and add a pair of brackets print a Th

Calling parent constructor with different argument list

2009-08-14 Thread pinkisntwell
class Vertex(tuple): pass class Positioned_Vertex(Vertex): def __init__(self, a, b): Vertex.__init__(a) a=Positioned_Vertex((0,0,0), 1) This gives: TypeError: tuple() takes at most 1 argument (2 given) It looks like the explicit call to Vertex.__init__ is never made and Vertex