You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
title='Adding support for _Bool to ctypes as c_bool'updated_at=<Date2007-03-13.20:45:04.000>user='https://bugs.python.org/chmod007'
ctypes/init.py should be cean for 'from ctypes import *',
but with your patch it exposes the 'struct_error' symbol.
I would recommend to change Modules/_ctypes/cfield.c so that a
c_bool type can be created even if HAVE_C99_BOOL is undefined (I think
you took that approach in your _Bool struct patch).
Then, ctypes/init.py would not have to depend on the struct 't'
typecode at all. The '_check_size(c_bool, "t")' check can probably be
ctypes/test/test_repr.py does not work.
Easy to fix this: just add c_bool to the list of types starting
at line 5.
These changes would also ensure compatibility with previous Python
versions, with one exception: A check for the _Bool type must be added
To answer your question: No, it is not needed to prepare a patch
relative to ctypes/trunk/ctypes. This repository contains
svn:external properties for the 'source' and 'ctypes' directories that
point into the 'release25-maint/Modules/_ctypes' and
'release25-maint/Lib/ctypes' directories from Python.
Thanks for the review, Thomas! I've attached a new patch that addresses the points you bring up (I hope) in the suggested manner. I have not tested it on 2.5, but tests pass on 2.6.
File Added: c_bool patch against r53623.diff