Ticket #517 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

remove dependency on structmember.h

Reported by: dalcinl Owned by: dalcinl
Priority: minor Milestone: 0.13
Component: Code Generation Keywords:


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


cdef_members.diff Download (23.6 KB) - added by dalcinl 5 years ago.

Change History

Changed 5 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

Changed 5 years ago by dalcinl

Changed 5 years ago by dalcinl

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.