Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#41 closed defect (fixed)

Bug accessing internals of Python long

Reported by: casevh@… Owned by: somebody
Priority: critical Milestone:
Component: Code Generation Keywords: MESSAGE
Cc: Quatre, Bornes


I am trying to access the internal structure of a Python long. The code
fragment below works when I use Pyrex but generates a compile error
when using Cython 0.9.8.

The code:

cdef extern from "Python.h":

ctypedef struct PyTypeObject?:


ctypedef struct PyObject?:

Py_ssize_t ob_refcnt
PyTypeObject? * ob_type

cdef extern from "longintrepr.h":

cdef struct _longobject:

int ob_refcnt
PyTypeObject? * ob_type
int ob_size
unsigned int * ob_digit

def test(temp = long(0)):

cdef _longobject *l
l = <_longobject *> temp
print sizeof(l.ob_size)
print sizeof(l.ob_digit[0])

Change History (5)

comment:1 Changed 7 years ago by robertwb

  • Priority changed from major to critical

comment:2 Changed 7 years ago by robertwb

This is due to #51

comment:3 Changed 7 years ago by robertwb

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 7 years ago by robertwb

  • Milestone set to

comment:5 Changed 7 years ago by SRJamess

  • Cc Quatre Bornes added
  • Keywords MESSAGE added

broadway music indiana merriville
<a href=>hawaiian styles of music </a>

<a href=> carman free music download</a> instamental song music music metre cabal york pa live music

Note: See TracTickets for help on using tickets.