[Python-Dev] check for PyUnicode_READY look backwards (original) (raw)

Victor Stinner victor.stinner at haypocalc.com
Fri Oct 7 10:49:35 CEST 2011


Le 07/10/2011 10:07, Stefan Krah a écrit :

Victor Stinner<victor.stinner at haypocalc.com> wrote:

Yes, I wrote if (PyUnicodeREADY(foo)), but I agree that it is confusing when you read the code, especially because we have also a PyUnicodeISREADY(foo) macro!

if (!PyUnicodeREADY(foo)) is not better, also because of PyUnicodeISREADY(foo). I prefer PyUnicodeISREADY(foo)< 0 over PyUnicodeISREADY(foo) == -1. Do you mean PyUnicodeREADY(foo)< 0? I also prefer that idiom.

Oops, yes I mean PyUnicode_READY(foo)< 0.

Victor



More information about the Python-Dev mailing list