[Cython] [cython-users] Re: Bringing Cython and PyPy closer together

Lisandro Dalcin dalcinl at gmail.com
Sun Mar 29 21:51:19 CEST 2015


On 29 March 2015 at 21:02, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Lisandro Dalcin schrieb am 29.03.2015 um 19:40:
>> On 29 March 2015 at 20:30, Lisandro Dalcin wrote:
>>> On 29 March 2015 at 16:10, Stefan Behnel wrote:
>>>> Why not call PyObject_RichCompareBool() to make cpyext itself compare the
>>>> value to 0?
>>>
>>> That should definitely work. Let me try to put a patch together.
>>
>> Stefan, how to you feel about abusing of Py_False in the call to
>> RichCompareBool ?
>
> Wow - evil idea! :)
>
> But then, it's only for cpyext - as long as it works there and comes with a
> comment, it's certainly as simple as it gets. bool is clearly defined as an
> int subtype in Python.
>
> Just remember to check the error code. Py_SIZE() can't fail in CPython, but
> comparisons can, sadly.
>

Please review: https://github.com/cython/cython/pull/377


============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459


More information about the cython-devel mailing list