This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Steve.Thompson
Recipients Steve.Thompson, theller
Date 2011-02-17.23:59:25
SpamBayes Score 8.6236884e-10
Marked as misclassified No
Message-id <1297987167.42.0.900007110424.issue11241@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-02-17 23:59:27Steve.Thompsonsetrecipients: + Steve.Thompson, theller
2011-02-17 23:59:27Steve.Thompsonsetmessageid: <1297987167.42.0.900007110424.issue11241@psf.upfronthosting.co.za>
2011-02-17 23:59:25Steve.Thompsonlinkissue11241 messages
2011-02-17 23:59:25Steve.Thompsoncreate