|
From: A.M. K. <aku...@us...> - 2001-10-30 21:36:08
|
Update of /cvsroot/py-howto/pyhowto
In directory usw-pr-cvs1:/tmp/cvs-serv10262
Modified Files:
python-22.tex
Log Message:
Rewrites and additions resulting from today's feedback
Index: python-22.tex
===================================================================
RCS file: /cvsroot/py-howto/pyhowto/python-22.tex,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** python-22.tex 2001/10/30 14:35:03 1.43
--- python-22.tex 2001/10/30 21:36:04 1.44
***************
*** 51,55 ****
%======================================================================
! \section{PEP 252: Type and Class Changes}
The largest and most far-reaching changes in Python 2.2 are to
--- 51,55 ----
%======================================================================
! \section{PEPs 252 and 253: Type and Class Changes}
The largest and most far-reaching changes in Python 2.2 are to
***************
*** 335,339 ****
--- 335,341 ----
rule is the same as the one followed by Common Lisp.
+ % XXX mention super()
+
\subsection{Attribute Access}
***************
*** 872,891 ****
Python 2.2 can also be compiled to use UCS-4, 32-bit unsigned
integers, as its internal encoding by supplying
! \longprogramopt{enable-unicode=ucs4} to the configure script. When
! built to use UCS-4 (a ``wide Python''), the interpreter can natively
! handle Unicode characters from U+000000 to U+110000, so the range of
! legal values for the \function{unichr()} function is expanded
accordingly. Using an interpreter compiled to use UCS-2 (a ``narrow
Python''), values greater than 65535 will still cause
\function{unichr()} to raise a \exception{ValueError} exception.
!
! % XXX is this still unimplemented?
! All this is the province of the still-unimplemented \pep{261}, ``Support
! for `wide' Unicode characters''; consult it for further details, and
! please offer comments on the PEP and on your experiences with the
! 2.2 beta releases.
! % XXX update previous line once 2.2 reaches beta or final.
! Another change is much simpler to explain. Since their introduction,
Unicode strings have supported an \method{encode()} method to convert
the string to a selected encoding such as UTF-8 or Latin-1. A
--- 874,892 ----
Python 2.2 can also be compiled to use UCS-4, 32-bit unsigned
integers, as its internal encoding by supplying
! \longprogramopt{enable-unicode=ucs4} to the configure script.
! (It's also possible to specify
! \longprogramopt{disable-unicode} to completely disable Unicode
! support.)
!
! When built to use UCS-4 (a ``wide Python''), the interpreter can
! natively handle Unicode characters from U+000000 to U+110000, so the
! range of legal values for the \function{unichr()} function is expanded
accordingly. Using an interpreter compiled to use UCS-2 (a ``narrow
Python''), values greater than 65535 will still cause
\function{unichr()} to raise a \exception{ValueError} exception.
! This is all described in \pep{261}, ``Support for `wide' Unicode
! characters''; consult it for further details.
! Another change is simpler to explain. Since their introduction,
Unicode strings have supported an \method{encode()} method to convert
the string to a selected encoding such as UTF-8 or Latin-1. A
***************
*** 929,934 ****
\begin{seealso}
! \seepep{261}{Support for `wide' Unicode characters}{PEP written by
! Paul Prescod. Not yet accepted or fully implemented.}
\end{seealso}
--- 930,935 ----
\begin{seealso}
! \seepep{261}{Support for `wide' Unicode characters}{Written by
! Paul Prescod.}
\end{seealso}
***************
*** 1075,1080 ****
more information about XML-RPC.
! \item The new \module{hmac} module implements implements the HMAC
algorithm described by \rfc{2104}.
\item The Python profiler has been extensively reworked and various
--- 1076,1098 ----
more information about XML-RPC.
! \item The new \module{hmac} module implements the HMAC
algorithm described by \rfc{2104}.
+ (Contributed by Gerhard H\"aring.)
+
+ \item Several functions that originally returned lengthy tuples now
+ return pseudo-sequences that still behave like tuples but also have
+ mnemonic attributes such as member{st_mtime} or \member{tm_year}.
+ The enhanced functions include \function{stat()},
+ \function{fstat()}, \function{statvfs()}, and \function{fstatvfs()}
+ in the \module{os} module, and \function{localtime()},
+ \function{gmtime()}, and \function{strptime()} in the \module{time}
+ module.
+
+ For example, to obtain a file's size using the old tuples, you'd end
+ up writing something like \code{file_size =
+ os.stat(filename)[stat.ST_SIZE]}, but now this can be written more
+ clearly as \code{file_size = os.stat(filename).st_size}.
+
+ The original patch for this feature was contributed by Nick Mathewson.
\item The Python profiler has been extensively reworked and various
***************
*** 1105,1109 ****
the \function{re.sub()} and \function{re.split()} functions have
been rewritten in C. Another contributed patch speeds up certain
! Unicode character ranges by a factor of two. (SRE is maintained by
Fredrik Lundh. The BIGCHARSET patch was contributed by Martin von
L\"owis.)
--- 1123,1130 ----
the \function{re.sub()} and \function{re.split()} functions have
been rewritten in C. Another contributed patch speeds up certain
! Unicode character ranges by a factor of two, and a new \method{finditer()}
! method that returns an iterator over all the non-overlapping matches in
! a given string.
! (SRE is maintained by
Fredrik Lundh. The BIGCHARSET patch was contributed by Martin von
L\"owis.)
***************
*** 1112,1116 ****
SMTP over TLS'', so it's now possible to encrypt the SMTP traffic
between a Python program and the mail transport agent being handed a
! message. (Contributed by Gerhard H\"aring.)
\item The \module{imaplib} module, maintained by Piers Lauder, has
--- 1133,1138 ----
SMTP over TLS'', so it's now possible to encrypt the SMTP traffic
between a Python program and the mail transport agent being handed a
! message. \module{smtplib} also supports SMTP authentication.
! (Contributed by Gerhard H\"aring.)
\item The \module{imaplib} module, maintained by Piers Lauder, has
***************
*** 1119,1122 ****
--- 1141,1145 ----
Baxter and Michel Pelletier.)
+ % XXX should the 'email' module get a section of its own?
\item The \module{rfc822} module's parsing of email addresses is now
compliant with \rfc{2822}, an update to \rfc{822}. (The module's
***************
*** 1303,1309 ****
file APIs. As MBCS is explicitly used by the file APIs, Python's
choice of ASCII as the default encoding turns out to be an
! annoyance.
! (Contributed by Mark Hammond with assistance from Marc-Andr\'e
! Lemburg.)
\item Large file support is now enabled on Windows. (Contributed by
--- 1326,1333 ----
file APIs. As MBCS is explicitly used by the file APIs, Python's
choice of ASCII as the default encoding turns out to be an
! annoyance. On Unix, the locale's character set is used if
! \function{locale.nl_langinfo(CODESET)} is available. (Windows
! support was contributed by Mark Hammond with assistance from
! Marc-Andr\'e Lemburg. Unix support was added by Martin von L\"owis.)
\item Large file support is now enabled on Windows. (Contributed by
***************
*** 1372,1378 ****
suggestions, corrections and assistance with various drafts of this
article: Fred Bremmer, Keith Briggs, Andrew Dalke, Fred~L. Drake, Jr.,
! Carel Fellinger, Mark Hammond, Stephen Hansen, Michael Hudson, Jack Jansen,
! Marc-Andr\'e Lemburg, Fredrik Lundh, Michael McLay, Tim Peters, Jens
! Quade, Tom Reinhardt, Neil Schemenauer, Guido van Rossum.
\end{document}
--- 1396,1403 ----
suggestions, corrections and assistance with various drafts of this
article: Fred Bremmer, Keith Briggs, Andrew Dalke, Fred~L. Drake, Jr.,
! Carel Fellinger, Mark Hammond, Stephen Hansen, Michael Hudson, Jack
! Jansen, Marc-Andr\'e Lemburg, Martin von L\"owis, Fredrik Lundh,
! Michael McLay, Nick Mathewson, Paul Moore, Tim Peters, Jens Quade, Tom
! Reinhardt, Neil Schemenauer, Guido van Rossum.
\end{document}
|