Terry J. Reedy added the comment: I agree with the proposal.
Some of the code seems redundant with code we already have. In Python, I would write def codepoint_from_U_notation(name, namelen): if not (4 <= namelen <= 6): raise <wrong length> return chr(int(name, 16)) maybe with try-except to re-write error messages like ValueError: invalid literal for int() with base 16: '99x3' ValueError: chr() arg not in range(0x110000) My point is that we already have code to convert hex strings to int; I presume PyUnicode_FromOrdinal(code) is the C version of 'chr' that already checks the max value. ---------- nosy: +terry.reedy _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18614> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com