diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/unicodedata.rst | 9 | ||||
-rw-r--r-- | Doc/reference/lexical_analysis.rst | 17 | ||||
-rw-r--r-- | Doc/whatsnew/3.3.rst | 6 |
3 files changed, 28 insertions, 4 deletions
diff --git a/Doc/library/unicodedata.rst b/Doc/library/unicodedata.rst index bcb3da3..d0783a2 100644 --- a/Doc/library/unicodedata.rst +++ b/Doc/library/unicodedata.rst @@ -29,6 +29,9 @@ following functions: Look up character by name. If a character with the given name is found, return the corresponding character. If not found, :exc:`KeyError` is raised. + .. versionchanged:: 3.3 + Support for name aliases [#]_ and named sequences [#]_ has been added. + .. function:: name(chr[, default]) @@ -160,3 +163,9 @@ Examples: >>> unicodedata.bidirectional('\u0660') # 'A'rabic, 'N'umber 'AN' + +.. rubric:: Footnotes + +.. [#] http://www.unicode.org/Public/6.0.0/ucd/NameAliases.txt + +.. [#] http://www.unicode.org/Public/6.0.0/ucd/NamedSequences.txt diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst index 4b49738..5900daa 100644 --- a/Doc/reference/lexical_analysis.rst +++ b/Doc/reference/lexical_analysis.rst @@ -492,13 +492,13 @@ Escape sequences only recognized in string literals are: +-----------------+---------------------------------+-------+ | Escape Sequence | Meaning | Notes | +=================+=================================+=======+ -| ``\N{name}`` | Character named *name* in the | | +| ``\N{name}`` | Character named *name* in the | \(4) | | | Unicode database | | +-----------------+---------------------------------+-------+ -| ``\uxxxx`` | Character with 16-bit hex value | \(4) | +| ``\uxxxx`` | Character with 16-bit hex value | \(5) | | | *xxxx* | | +-----------------+---------------------------------+-------+ -| ``\Uxxxxxxxx`` | Character with 32-bit hex value | \(5) | +| ``\Uxxxxxxxx`` | Character with 32-bit hex value | \(6) | | | *xxxxxxxx* | | +-----------------+---------------------------------+-------+ @@ -516,10 +516,14 @@ Notes: with the given value. (4) + .. versionchanged:: 3.3 + Support for name aliases [#]_ has been added. + +(5) Individual code units which form parts of a surrogate pair can be encoded using this escape sequence. Exactly four hex digits are required. -(5) +(6) Any Unicode character can be encoded this way, but characters outside the Basic Multilingual Plane (BMP) will be encoded using a surrogate pair if Python is compiled to use 16-bit code units (the default). Exactly eight hex digits @@ -706,3 +710,8 @@ The following printing ASCII characters are not used in Python. Their occurrence outside string literals and comments is an unconditional error:: $ ? ` + + +.. rubric:: Footnotes + +.. [#] http://www.unicode.org/Public/6.0.0/ucd/NameAliases.txt diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index b433c6c..d08ee62 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -179,6 +179,12 @@ Some smaller changes made to the core Python language are: * Stub +Added support for Unicode name aliases and named sequences. +Both :func:`unicodedata.lookup()` and '\N{...}' now resolve name aliases, +and :func:`unicodedata.lookup()` resolves named sequences too. + +(Contributed by Ezio Melotti in :issue:`12753`) + New, Improved, and Deprecated Modules ===================================== |