Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6)

#10542: Py_UNICODE_NEXT and other macros for surrogates

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 2 months ago by alexander.belopolsky
Modified:
8 years, 9 months ago
Reviewers:
CC:
lemburg, loewis, doerwalter, Georg, rhettinger, amaury.forgeotdarc, sasha, rhamph_gmail.com, AntoinePitrou, haypo, eric.smith, Benjamin Peterson, stutzbach, ezio.melotti, devnull_psf.upfronthosting.co.za, tchrist_perl.com, stutzbach, rhettinger, devnull_psf.upfronthosting.co.za, sasha
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Total comments: 4

Patch Set 6 #

Patch Set 7 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/c-api/unicode.rst View 1 chunk +21 lines, -0 lines 0 comments Download
Include/unicodeobject.h View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 1
belopolsky_users.sourceforge.net
8 years, 9 months ago #1
http://bugs.python.org/review/10542/diff/3174/9874
File Objects/unicodeobject.c (right):

http://bugs.python.org/review/10542/diff/3174/9874#newcode81
Objects/unicodeobject.c:81: /* test if a character is in U+10000-U+10FFFF,
When writing ranges in comments, please use notation that makes it clear that
the range is inclusive.  If you find [a, b] notation ambiguous, you can spell it
out - [a, b] inclusive.

http://bugs.python.org/review/10542/diff/3174/9874#newcode83
Objects/unicodeobject.c:83: #define IS_NONBMP(ch) (ch >= 0x10000)
You can avoid using negation in the macro name (and the resulting double
negation if you want to check for BMP) if you call this IS_SUPPLEMENTARY. Longer
spelling may be a feature because it makes it similar in length to say
IS_LOW_SURROGATE.

http://bugs.python.org/review/10542/diff/3174/9874#newcode94
Objects/unicodeobject.c:94: /* high surrogate = top 10 bits added to D800,
This is dangerously close to restating clear code in a confusing comment.

http://bugs.python.org/review/10542/diff/3174/9874#newcode95
Objects/unicodeobject.c:95: ordinal has to be in [0x0000; 0xFFFF]: use ordinal
-= 0x10000 */
Please be consistent in how you spell ranges.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+