[New-bugs-announce] [issue16330] Use surrogate-related macros

Serhiy Storchaka report at bugs.python.org
Fri Oct 26 17:42:56 CEST 2012


New submission from Serhiy Storchaka:

A set of macros to work with surrogates was introduced in 3.3: Py_UNICODE_IS_SURROGATE, Py_UNICODE_IS_HIGH_SURROGATE, Py_UNICODE_IS_LOW_SURROGATE, Py_UNICODE_JOIN_SURROGATES, Py_UNICODE_HIGH_SURROGATE, and Py_UNICODE_LOW_SURROGATE.  Using this macros makes a code more readable, protect from errors, and allows use the one most effective implementation.  But not all surrogate-related code uses this macros.  I suppose this is done inadvertently, somewhere the macro and naked code used in neighboring lines.

The proposed patch replaces a naked surrogate code to macros in all places except expat (which is a foreign code).

----------
components: Interpreter Core, Unicode
files: use_surrogate_macros.patch
keywords: patch
messages: 173855
nosy: ezio.melotti, haypo, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Use surrogate-related macros
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file27730/use_surrogate_macros.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16330>
_______________________________________


More information about the New-bugs-announce mailing list