Opened 7 years ago

Last modified 6 years ago

#152 new defect

subtyping PyVarObject (e.g. bytes/tuple)

Reported by: scoder Owned by: somebody
Priority: major Milestone: wishlist
Component: Code Generation Keywords:

Description (last modified by scoder)

The problem with a PyVarObject (such as bytes or tuple) is that its struct is of variable length that is determined at instance creation time. When Cython generates subclass code, it expects to be able to add fields directly behind the compile time struct, which thus end up in the variably allocated memory area.

Change History (3)

comment:1 Changed 7 years ago by scoder

  • Description modified (diff)

comment:2 Changed 6 years ago by scoder

This also impacts the tp_dictoffset slot, so it has an impact on PyVarObject subtypes that use an instance __dict__.

comment:3 Changed 6 years ago by scoder

  • Description modified (diff)
  • Summary changed from subtyping PyVarObject (e.g. str) to subtyping PyVarObject (e.g. bytes/tuple)
Note: See TracTickets for help on using tickets.