[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-30 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 5e23532f694d by Amaury Forgeot d'Arc in branch '3.2': Issue #11241: subclasses of ctypes.Array can now be subclassed. http://hg.python.org/cpython/rev/5e23532f694d -- nosy: +python-dev

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-30 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- resolution: accepted - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11241

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-30 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Thanks a lot for committing this for me Amaury. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11241 ___

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-25 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: This patch was marked as accepted, but it doesn't seem to be committed. Will someone commit it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11241

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Yes, the patch looks good! -- resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11241 ___

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-08-12 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Amaury, how about this patch? I got rid of querying the type dictionary and hoisted the creation of the type instance earlier. Then 'PyObject_GetAttrString' can be used to lookup '_length_' and '_type_' by the regular Python attribute lookup

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-04-18 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: In the patch, _length_ is searched in the class and its base class. But what happens with a third level? class my_array3(my_array2): pass -- ___ Python tracker rep...@bugs.python.org

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-04-18 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: But what happens with a third level? That doesn't work. I have a test case for that, but the test case has a typo that caused it to pass. I will fix the test case and the code. Thanks. -- ___

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-04-17 Thread Meador Inge
Meador Inge mead...@gmail.com added the comment: Verified that this is still broken in the main development branch. The base type should be checked for '_type_' or '_length_' before throwing an error. Attached is a patch that fixes the problem and adds covering tests. The full test suite

[issue11241] ctypes: subclassing an already subclassed ArrayType generates AttributeError

2011-02-17 Thread Steve Thompson
New submission from Steve Thompson steve.f.thomp...@gmail.com: Consider the following: python code: class my_array( ctypes.Array ): _type_= ctypes.c_uint8 _length_ = 256 class my_array2( my_array ): pass Output: class my_array2( my_array ): AttributeError: class must define a