cython/cython — pull request #126 by bfroehle (2012-05-30 23:40:28+00:00)
Title: cpython.type: Add ctypedef for `__builtin__.type`

I've added a ctypedef for `__builtin__.type` in `cpython.type`. By cimport'ing this ctypedef, Cython is able to generate code which correctly compiles in C++ for functions like `PyType_IsSubtype` (see `tests/run/pytype.pyx`) and `PyArray_New`.

One small hiccup is that `PyType_Type.tp_basicsize != sizeof(PyTypeObject)`. To get around this, I defined a new dictionary in `Compiler.Code` which holds a mapping between the claimed object type and the type which should be put into sizeof.