Re: deriving from array.array

2010-01-26 Thread Alf P. Steinbach
* Torsten Mohr: thanks a lot for your hint, it works fine. I get an error for "a = Abc(4, 5)", seems the parameters are forwarded to array's __init__ as they are. No, with CPython they're forwarded to __new__. Not sure if i understand this correctly, if i derive from other classes (like wxp

Re: deriving from array.array

2010-01-26 Thread Jerry Hill
On Tue, Jan 26, 2010 at 2:28 PM, Torsten Mohr wrote: > Is there a way to find out what i need to call? I haven't found much in > the documentation. From writing C extensions i knew about the "new" entry > in the PyTypeObject struct but it seems there's more behind it. > In docs.python.org i did

Re: deriving from array.array

2010-01-26 Thread Torsten Mohr
Hello, thanks a lot for your hint, it works fine. >> I get an error for "a = Abc(4, 5)", seems the parameters are >> forwarded to array's __init__ as they are. > > No, with CPython they're forwarded to __new__. Not sure if i understand this correctly, if i derive from other classes (like wxpyth

Re: deriving from array.array

2010-01-26 Thread Alf P. Steinbach
* Alf P. Steinbach: * Torsten Mohr: Hello, i try to derive a class from array.array: import array class Abc(array.array): def __init__(self, a, b): array.array.__init__(self, 'B') self.a = a self.b = b a = Abc(4, 5) print a print a.a I get an error for "a = Ab

Re: deriving from array.array

2010-01-26 Thread Alf P. Steinbach
* Torsten Mohr: Hello, i try to derive a class from array.array: import array class Abc(array.array): def __init__(self, a, b): array.array.__init__(self, 'B') self.a = a self.b = b a = Abc(4, 5) print a print a.a I get an error for "a = Abc(4, 5)", seems the p

deriving from array.array

2010-01-26 Thread Torsten Mohr
Hello, i try to derive a class from array.array: import array class Abc(array.array): def __init__(self, a, b): array.array.__init__(self, 'B') self.a = a self.b = b a = Abc(4, 5) print a print a.a I get an error for "a = Abc(4, 5)", seems the parameters are forw