diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2006-04-23 16:35:19 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2006-04-23 16:35:19 (GMT) |
commit | 09b1bc39e7d5405225dcff042ca17afea5389ee0 (patch) | |
tree | cbd23bcae22512a7803945b38db463ea67dde6de /Doc | |
parent | e0ea50bc3b09e0f3b4f5fd3a531deeae94bcbb6d (diff) | |
download | cpython-09b1bc39e7d5405225dcff042ca17afea5389ee0.zip cpython-09b1bc39e7d5405225dcff042ca17afea5389ee0.tar.gz cpython-09b1bc39e7d5405225dcff042ca17afea5389ee0.tar.bz2 |
Take 2 on mentioning the with statement, this time without inadvertently killing the Unicode examples
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/tut/tut.tex | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex index 8df5510..e01f254 100644 --- a/Doc/tut/tut.tex +++ b/Doc/tut/tut.tex @@ -941,9 +941,9 @@ with \function{str()}, conversion takes place using this default encoding. u'abc' >>> str(u"abc") 'abc' ->>> u"�" +>>> u"äöü" u'\xe4\xf6\xfc' ->>> str(u"�") +>>> str(u"äöü") Traceback (most recent call last): File "<stdin>", line 1, in ? UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128) @@ -955,7 +955,7 @@ that takes one argument, the name of the encoding. Lowercase names for encodings are preferred. \begin{verbatim} ->>> u"�".encode('utf-8') +>>> u"äöü".encode('utf-8') '\xc3\xa4\xc3\xb6\xc3\xbc' \end{verbatim} @@ -3744,6 +3744,7 @@ In real world applications, the \keyword{finally} clause is useful for releasing external resources (such as files or network connections), regardless of whether the use of the resource was successful. + \section{Predefined Clean-up Actions \label{cleanup-with}} Some objects define standard clean-up actions to be undertaken when @@ -3775,6 +3776,7 @@ even if a problem was encountered while processing the lines. Other objects which provide predefined clean-up actions will indicate this in their documentation. + \chapter{Classes \label{classes}} Python's class mechanism adds classes to the language with a minimum |