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 '_length_' attribute, which must be a positive integer This is analogous to the C code typedef char my_array[ 256 ]; typedef my_array my_array2; However, the python code raises exceptions claiming _type_ and _length_ have not been defined. This seems like a bug. I shouldn't need to redefine _type_ and _length_, otherwise there was no point in subclassing my_array. I tried to step into this using pdb but didn't have any luck. ---------- assignee: theller components: ctypes messages: 128769 nosy: Steve.Thompson, theller priority: normal severity: normal status: open title: ctypes: subclassing an already subclassed ArrayType generates AttributeError type: behavior versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11241> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com