summaryrefslogtreecommitdiffstats
path: root/Doc/tut/tut.tex
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-05-07 17:49:36 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-05-07 17:49:36 (GMT)
commita02469f9692cc5c1503dd35728c61789f4e8242f (patch)
tree46a0f7f6adb0fd12d6c167ef6eaa842114d92c39 /Doc/tut/tut.tex
parenta2f84ceda54b17af3b79fb63ec3d1ba5e738c2ce (diff)
downloadcpython-a02469f9692cc5c1503dd35728c61789f4e8242f.zip
cpython-a02469f9692cc5c1503dd35728c61789f4e8242f.tar.gz
cpython-a02469f9692cc5c1503dd35728c61789f4e8242f.tar.bz2
More message updates and minor fixes.
Diffstat (limited to 'Doc/tut/tut.tex')
-rw-r--r--Doc/tut/tut.tex19
1 files changed, 9 insertions, 10 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex
index 6c3758c..fe19c11 100644
--- a/Doc/tut/tut.tex
+++ b/Doc/tut/tut.tex
@@ -1467,7 +1467,7 @@ Here's an example that fails due to this restriction:
>>> function(0, a=0)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
-TypeError: keyword parameter redefined
+TypeError: function() got multiple values for keyword argument 'a'
\end{verbatim}
When a final formal parameter of the form \code{**\var{name}} is
@@ -1875,9 +1875,8 @@ of the comprehension:
>>> x = 100 # this gets overwritten
>>> [x**3 for x in range(5)]
[0, 1, 8, 27, 64]
->>> x
-4 # the final value for range(5)
->>
+>>> x # the final value for range(5)
+4
\end{verbatim}
@@ -1889,8 +1888,7 @@ remove slices from a list (which we did earlier by assignment of an
empty list to the slice). For example:
\begin{verbatim}
->>> a
-[-1, 1, 66.6, 333, 333, 1234.5]
+>>> a = [-1, 1, 66.6, 333, 333, 1234.5]
>>> del a[0]
>>> a
[1, 66.6, 333, 333, 1234.5]
@@ -2036,7 +2034,7 @@ Here is a small example using a dictionary:
>>> tel.keys()
['guido', 'irv', 'jack']
>>> tel.has_key('guido')
-1
+True
\end{verbatim}
The \function{dict()} contructor builds dictionaries directly from
@@ -2428,7 +2426,8 @@ prompts:
>>> sys.ps1 = 'C> '
C> print 'Yuck!'
Yuck!
-C>
+C>
+
\end{verbatim}
These two variables are only defined if the interpreter is in
@@ -3135,7 +3134,7 @@ however, and result in error messages as shown here:
>>> 10 * (1/0)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
-ZeroDivisionError: integer division or modulo
+ZeroDivisionError: integer division or modulo by zero
>>> 4 + spam*3
Traceback (most recent call last):
File "<stdin>", line 1, in ?
@@ -3143,7 +3142,7 @@ NameError: name 'spam' is not defined
>>> '2' + 2
Traceback (most recent call last):
File "<stdin>", line 1, in ?
-TypeError: illegal argument type for built-in operation
+TypeError: cannot concatenate 'str' and 'int' objects
\end{verbatim}
The last line of the error message indicates what happened.