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

Skip to content

Commit 7770767

Browse files
committed
Move C-level changes into a section of their own
Add string.ascii_letters Remove duplicate MBCS paragraph
1 parent d627791 commit 7770767

1 file changed

Lines changed: 64 additions & 36 deletions

File tree

Doc/whatsnew/whatsnew22.tex

Lines changed: 64 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -574,35 +574,31 @@ \section{New and Improved Modules}
574574
now compliant with \rfc{2822}, an update to \rfc{822}. The module's
575575
name is \emph{not} going to be changed to \samp{rfc2822}.
576576
(Contributed by Barry Warsaw.)
577-
577+
578+
\item New constants \constant{ascii_letters},
579+
\constant{ascii_lowercase}, and \constant{ascii_uppercase} were
580+
added to the \module{string} module. There were several modules in
581+
the standard library that used \constant{string.letters} to mean the
582+
ranges A-Za-z, but that assumption is incorrect when locales are in
583+
use, because \constant{string.letters} varies depending on the set
584+
of legal characters defined by the current locale. The buggy
585+
modules have all been fixed to use \constant{ascii_letters} instead.
586+
(Reported by an unknown person; fixed by Fred L. Drake, Jr.)
587+
578588
\end{itemize}
579589

580590

581591
%======================================================================
582-
\section{Other Changes and Fixes}
592+
\section{Interpreter Changes and Fixes}
583593

584-
% XXX update the patch and bug figures as we go
585-
As usual there were a bunch of other improvements and bugfixes
586-
scattered throughout the source tree. A search through the CVS change
587-
logs finds there were 43 patches applied, and 77 bugs fixed; both
588-
figures are likely to be underestimates. Some of the more notable
589-
changes are:
594+
Some of the changes only affect people who deal with the Python
595+
interpreter at the C level, writing Python extension modules,
596+
embedding the interpreter, or just hacking on the interpreter itself.
597+
If you only write Python code, none of the changes described here will
598+
affect you very much.
590599

591600
\begin{itemize}
592601

593-
\item Keyword arguments passed to builtin functions that don't take them
594-
now cause a \exception{TypeError} exception to be raised, with the
595-
message "\var{function} takes no keyword arguments".
596-
597-
\item The code for the Mac OS port for Python, maintained by Jack
598-
Jansen, is now kept in the main Python CVS tree.
599-
600-
\item The new license introduced with Python 1.6 wasn't
601-
GPL-compatible. This is fixed by some minor textual changes to the
602-
2.2 license, so Python can now be embedded inside a GPLed program
603-
again. The license changes were also applied to the Python 2.0.1
604-
and 2.1.1 releases.
605-
606602
\item Profiling and tracing functions can now be implemented in C,
607603
which can operate at much higher speeds than Python-based functions
608604
and should reduce the overhead of enabling profiling and tracing, so
@@ -623,27 +619,59 @@ \section{Other Changes and Fixes}
623619
\cfunction{PyThreadState_Next()} allow looping over all the thread
624620
states for a given interpreter. (Contributed by David Beazley.)
625621

626-
% XXX is this explanation correct?
627-
\item When presented with a Unicode filename on Windows, Python will
628-
now correctly convert it to a string using the MBCS encoding.
629-
Filenames on Windows are a case where Python's choice of ASCII as
630-
the default encoding turns out to be an annoyance.
622+
\item A new \samp{et} format sequence was added to
623+
\cfunction{PyArg_ParseTuple}; \samp{et} takes both a parameter and
624+
an encoding name, and converts the parameter to the given encoding
625+
if the parameter turns out to be a Unicode string, or leaves it
626+
alone if it's an 8-bit string, assuming it to already be in the
627+
desired encoding. This differs from the \samp{es} format character,
628+
which assumes that 8-bit strings are in Python's default ASCII
629+
encoding and converts them to the specified new encoding.
630+
(Contributed by M.-A. Lemburg, and used for the MBCS support on
631+
Windows described in the previous section.)
632+
633+
\item Two new wrapper functions, \cfunction{PyOS_snprintf()} and
634+
\cfunction{PyOS_vsnprintf()} were added. which provide a cross-platform
635+
implementations for the relatively new snprintf()/vsnprintf() C lib
636+
APIs. In contrast to the standard sprintf() and vsprintf() C lib
637+
APIs, these versions apply bounds checking on the used buffer which
638+
enhances protection against buffer overruns.
639+
(Contributed by M.-A. Lemburg.)
640+
641+
\end{itemize}
642+
643+
644+
%======================================================================
645+
\section{Other Changes and Fixes}
646+
647+
% XXX update the patch and bug figures as we go
648+
As usual there were a bunch of other improvements and bugfixes
649+
scattered throughout the source tree. A search through the CVS change
650+
logs finds there were 43 patches applied, and 77 bugs fixed; both
651+
figures are likely to be underestimates. Some of the more notable
652+
changes are:
653+
654+
\begin{itemize}
655+
656+
\item Keyword arguments passed to builtin functions that don't take them
657+
now cause a \exception{TypeError} exception to be raised, with the
658+
message "\var{function} takes no keyword arguments".
659+
660+
\item The code for the Mac OS port for Python, maintained by Jack
661+
Jansen, is now kept in the main Python CVS tree.
662+
663+
\item The new license introduced with Python 1.6 wasn't
664+
GPL-compatible. This is fixed by some minor textual changes to the
665+
2.2 license, so Python can now be embedded inside a GPLed program
666+
again. The license changes were also applied to the Python 2.0.1
667+
and 2.1.1 releases.
631668

632669
\item When presented with a Unicode filename on Windows, Python will
633670
now convert it to an MBCS encoded string, as used by the Microsoft
634671
file APIs. As MBCS is explicitly used by the file APIs, Python's
635672
choice of ASCII as the default encoding turns out to be an
636673
annoyance.
637674

638-
This patch also adds \samp{et} as a format sequence to
639-
\cfunction{PyArg_ParseTuple}; \samp{et} takes both a parameter and
640-
an encoding name, and converts it to the given encoding if the
641-
parameter turns out to be a Unicode string, or leaves it alone if
642-
it's an 8-bit string, assuming it to already be in the desired
643-
encoding. (This differs from the \samp{es} format character, which
644-
assumes that 8-bit strings are in Python's default ASCII encoding
645-
and converts them to the specified new encoding.)
646-
647675
(Contributed by Mark Hammond with assistance from Marc-Andr\'e
648676
Lemburg.)
649677

@@ -683,7 +711,7 @@ \section{Other Changes and Fixes}
683711
to load extension modules, it's now possible to set the flags used
684712
by \cfunction{dlopen()} using the \function{sys.getdlopenflags()} and
685713
\function{sys.setdlopenflags()} functions. (Contributed by Bram Stolk.)
686-
714+
687715
\end{itemize}
688716

689717

0 commit comments

Comments
 (0)