Author ezio.melotti
Recipients Arfrever, Rhamphoryncus, amaury.forgeotdarc, belopolsky, ezio.melotti, lemburg, tchrist, vstinner
Date 2011-08-19.15:54:59
SpamBayes Score 9.30322e-12
Marked as misclassified No
Message-id <1313769303.04.0.0179228950809.issue9200@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a new version of the patch.
I decided to leave the prefix anyway, for consistency with what I'll commit to 3.3 and because without the prefix NEXT() looks ambiguous (and it's not entirely clear if it's private or not).
I rewrote the macro as Victor suggested and tested that it still works (I also added a test with surrogates).
The macros are now called _Py_UNICODE_IS_{LOW|HIGH}_SURROGATE, with '_'s.  I also tried the implementation proposed in #12751 and benchmarked with:
$ ./python -m timeit -s 's = "\uD800\uD8000\uDFFF\uDFFF\uDFFF"*1000' 's.islower()'
and got "1000 loops, best of 3: 345 usec per loop" on both, so I left the old version because I think it's more readable.
Finally, I rewrote the comment about the macro, adding a note about its side effects.
History
Date User Action Args
2011-08-19 15:55:03ezio.melottisetrecipients: + ezio.melotti, lemburg, amaury.forgeotdarc, belopolsky, Rhamphoryncus, vstinner, Arfrever, tchrist
2011-08-19 15:55:03ezio.melottisetmessageid: <1313769303.04.0.0179228950809.issue9200@psf.upfronthosting.co.za>
2011-08-19 15:55:02ezio.melottilinkissue9200 messages
2011-08-19 15:55:02ezio.melotticreate