[Cython] PyMethod_New compatibility

Kai Huuhko kai.huuhko at gmail.com
Fri Mar 6 12:02:29 CET 2015


perjantai 6. maaliskuuta 2015 10.54.23 UTC+2 Stefan Behnel kirjoitti:
>
> [moving to cython-users mailing list] 
>
> Kai Huuhko schrieb am 06.03.2015 um 06:55: 
> > This change: 
> > 
> https://github.com/cython/cython/commit/499d98628a8a929ed065bf38ee4ec6405145e092 
> > 
> > removed compatibility code for PyMethod_New to have the same signature 
> > with both py2 and py3. Is there an alternative way - that is py2/py3 
> > compatible - within a code block to bind functions to an instance? 
> > 
> > For reference, we use it here: 
> > 
> https://git.enlightenment.org/bindings/python/python-efl.git/tree/efl/evas/efl.evas_object_smart.pxi#n431 
>
> You can set the compiler directive "binding=True", that will allow Cython 
> functions to bind as methods. 
>
> Stefan 
>
>
The code is from before my time and there are no code comments so I can 
only guess what the original author(s) were thinking.

The __cinit__ there is binding methods from other extension classes, which 
doesn't work using this new Cython function binding mechanism. I think it's 
doing the binding there needlessly though, since the methods are from the 
parent class and the class itself(!).

Why it's not doing simple class inheritance, is beyond me. Time to dig 
through the revision control history for clues.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20150306/96da85fa/attachment.html>


More information about the cython-devel mailing list