Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6d2a04

Browse files
committed
More Unicode corrections from MAL to match a post-2.2a1 change
Mention additional new imaplib.py features (Don't expect to see an updated version of the Web page until around the 28th of July. Vacation time!)
1 parent 6c6bfb7 commit a6d2a04

1 file changed

Lines changed: 13 additions & 23 deletions

File tree

Doc/whatsnew/whatsnew22.tex

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -339,33 +339,22 @@ \section{PEP 255: Simple Generators}
339339
\section{Unicode Changes}
340340

341341
Python's Unicode support has been enhanced a bit in 2.2. Unicode
342-
strings are usually stored as UTF-16, as 16-bit unsigned integers.
342+
strings are usually stored as UCS-2, as 16-bit unsigned integers.
343343
Python 2.2 can also be compiled to use UCS-4, 32-bit unsigned
344344
integers, as its internal encoding by supplying
345345
\longprogramopt{enable-unicode=ucs4} to the configure script. When
346346
built to use UCS-4 (a ``wide Python''), the interpreter can natively
347-
handle Unicode characters from U+000000 to U+110000. The range of
348-
legal values for the \function{unichr()} function has been expanded;
349-
it used to only accept values up to 65535, but in 2.2 will accept
350-
values from 0 to 0x110000. Using a ``narrow Python'', an interpreter
351-
compiled to use UTF-16, values greater than 65535 will result in
352-
\function{unichr()} returning a string of length 2:
353-
354-
\begin{verbatim}
355-
>>> s = unichr(65536)
356-
>>> s
357-
u'\ud800\udc00'
358-
>>> len(s)
359-
2
360-
\end{verbatim}
361-
362-
This possibly-confusing behaviour, breaking the intuitive invariant
363-
that \function{chr()} and\function{unichr()} always return strings of
364-
length 1, may be changed later in 2.2 depending on public reaction.
347+
handle Unicode characters from U+000000 to U+110000, so the range of
348+
legal values for the \function{unichr()} function is expanded
349+
accordingly. Using an interpreter compiled to use UCS-2 (a ``narrow
350+
Python''), values greater than 65535 will still cause
351+
\function{unichr()} to raise a \exception{ValueError} exception.
365352

366353
All this is the province of the still-unimplemented PEP 261, ``Support
367354
for `wide' Unicode characters''; consult it for further details, and
368-
please offer comments and suggestions on the proposal it describes.
355+
please offer comments on the PEP and on your experiences with the
356+
2.2 alpha releases.
357+
% XXX update previous line once 2.2 reaches beta.
369358

370359
Another change is much simpler to explain. Since their introduction,
371360
Unicode strings have supported an \method{encode()} method to convert
@@ -576,9 +565,10 @@ \section{New and Improved Modules}
576565
two. (SRE is maintained by Fredrik Lundh. The BIGCHARSET patch was
577566
contributed by Martin von L\"owis.)
578567

579-
\item The \module{imaplib} module now has support for the IMAP
580-
NAMESPACE extension defined in \rfc{2342}. (Contributed by Michel
581-
Pelletier.)
568+
\item The \module{imaplib} module, maintained by Piers Lauder, has
569+
support for several new extensions: the NAMESPACE extension defined
570+
in \rfc{2342}, SORT, GETACL and SETACL. (Contributed by Anthony
571+
Baxter and Michel Pelletier.)
582572

583573
\item The \module{rfc822} module's parsing of email addresses is
584574
now compliant with \rfc{2822}, an update to \rfc{822}. The module's

0 commit comments

Comments
 (0)