remove dependency on structmember.h
|Reported by:||dalcinl||Owned by:||dalcinl|
We could get rid of structmember.h by using the a code transform to manage cdef public/readonly members via properties.
1) structmember.h has no namespace protection using a Py_ prefix for the many 'T_XXX' definitions. This can conflict with user code (BTW, and this issue was reported in cython-users ML).
2) when using PyMemberDef? tables from structmember.h, C <-> Python conversions are outside Cython's control of to_py/from_py converters. Using a transform+property mechanism is more consistent, and actually extend (for free, with no special casing at all) the types that can be made cdef public/readonly members (e.g. complex numbers, C struct's)
1) Generated code is less readable and larger
Change History (3)
comment:1 Changed 6 years ago by dalcinl
- Status changed from new to assigned
- Summary changed from remove dependency on CPython's structmember.h to remove dependency on structmember.h