Carl Witty, 11.08.2010 23:49:
> Before #561, if a cdef class defined __long__ and not __int__, then
> they would get both __int__ and __long__ methods available from Python
> (where the __int__ wrapper was generated by Python and the __long__
> wrapper was generated by Cython).
>
> After #561, this is still true for Python 2 (except that the __long__
> wrapper is generated by Python), but for Python 3 only an __int__
> method is available from Python.
>
> In favor of the current post-561 behavior: who cares if there's a
> __long__ method under Python 3 (that's not backed by a type slot)?

Py2's __long__ is the closest equivalent to __int__ in Py3, so I think the 
case that a user defines a __long__ method but no __int__ method should let 
Cython generate an __int__ method in Py3.

BTW, this means we have to check the inheritance hierarchy to make sure 
there really isn't an __int__ method around that should be used instead, 
but AFAIR, this is done anyway.

Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to