Cython disregards the c-name for "cdef public" class members

Bug #151560 reported by Vasil Manolov
2
Affects Status Importance Assigned to Milestone
Cython
Fix Committed
Undecided
Unassigned

Bug Description

Cython disregards the specified c-name (http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/external.html#CNameSpecs) for "cdef public" members of cdef class when generating the member table code. For example:

cdef class Spam:
    cdef public int eggs "_internal_name"

will generate something like

static struct PyMemberDef __pyx_members_4test_Spam[] = {
  {"eggs", T_INT, offsetof(struct __pyx_obj_4test_Spam, eggs), 0, 0}, // instead of offsetof(struct __pyx_obj_4test_Spam, _internal_name),
  {0, 0, 0, 0, 0}
};

which causes compile error.

Revision history for this message
Vasil Manolov (bluecreature) wrote :

Here's a patch to fix it.

robertwb (robertwb)
Changed in cython:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.