Message128769
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. |
|
Date |
User |
Action |
Args |
2011-02-17 23:59:27 | Steve.Thompson | set | recipients:
+ Steve.Thompson, theller |
2011-02-17 23:59:27 | Steve.Thompson | set | messageid: <1297987167.42.0.900007110424.issue11241@psf.upfronthosting.co.za> |
2011-02-17 23:59:25 | Steve.Thompson | link | issue11241 messages |
2011-02-17 23:59:25 | Steve.Thompson | create | |
|