Hello all,
I'm trying to subclass array.array but having problems with a default
parameter in the init constructor. Example:
import array
class TestClass(array .array):
def __init__(self, array_type = "B"):
array.array(arr ay_type)
[color=blue][color=green][color=darkred]
>>> temp = TestClass()[/color][/color][/color]
Traceback (most recent call last):
File "<pyshell#1 >", line 1, in ?
temp = TestClass()
TypeError: array() takes at least 1 argument (0 given)
I think there is something that I'm not understanding here. Any help
is appreciated.
Thanks,
Gus
I'm trying to subclass array.array but having problems with a default
parameter in the init constructor. Example:
import array
class TestClass(array .array):
def __init__(self, array_type = "B"):
array.array(arr ay_type)
[color=blue][color=green][color=darkred]
>>> temp = TestClass()[/color][/color][/color]
Traceback (most recent call last):
File "<pyshell#1 >", line 1, in ?
temp = TestClass()
TypeError: array() takes at least 1 argument (0 given)
I think there is something that I'm not understanding here. Any help
is appreciated.
Thanks,
Gus
Comment