Hello.

I have a feauture request. Support metaclass for cdef'ed classes. I have a 
workaround, but it has some limitations.

The trick changes ctype.ob_base.ob_base.ob_type for python3 or ctype.ob_type 
for python2 to the metaclass type:

   installation hook:
   https://github.com/ya-mouse/qbee/blob/master/src/_core.pyx#L30

   metaclass definition:
   https://github.com/ya-mouse/qbee/blob/master/src/_core.pyx#L139

   execution a hook:
   https://github.com/ya-mouse/qbee/blob/master/src/_core.pyx#L201


There is a limitation for the inherited cdef'ed class:

   this class on instantiation wouldn't call anything from metaclass:
   https://github.com/ya-mouse/simavr/blob/qbee/simavr/_simavr.pyx#L210

   to achieve the needed behaviour we have to define an empty regular Python 
class with cdef'ed base class:
   https://github.com/ya-mouse/simavr/blob/qbee/simavr/_simavr.pyx#L293

Workaround was originally found here:

   
http://git.enlightenment.org/legacy/bindings/python/python-evas.git/tree/evas/evas.c_evas.pyx#n658


18.01.2015, 02:11, "Robert Bradshaw" <rober...@gmail.com>:
>  It's been too long since we've done a release, and the features have
>  started to pile up, so I'm getting the ball rolling with 0.22.alpha0.
>  I've uploaded a tarball to
>  http://cython.org/release/Cython-0.22.alpha0.tar.gz; you can also get
>  it from github.
>
>  Let me know what breaks/works for you, and if there's anything you
>  think should get in. If feedback is good I'll be cutting a beta (to
>  the users list) next week.
>
>  - Robert
>  _______________________________________________
>  cython-devel mailing list
>  cython-devel@python.org
>  https://mail.python.org/mailman/listinfo/cython-devel

-- 
Anton D. Kachalov
_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to