Ticket #517 (closed enhancement: fixed)
remove dependency on structmember.h
| Reported by: | dalcinl | Owned by: | dalcinl |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.13 |
| Component: | Code Generation | Keywords: | |
| Cc: |
Description
We could get rid of structmember.h by using the a code transform to manage cdef public/readonly members via properties.
Pros:
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)
Cons:
1) Generated code is less readable and larger

