diff options
-rw-r--r-- | Doc/ref/ref6.tex | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Doc/ref/ref6.tex b/Doc/ref/ref6.tex index 8eee5b8..6698f46 100644 --- a/Doc/ref/ref6.tex +++ b/Doc/ref/ref6.tex @@ -204,12 +204,12 @@ attribute; if it cannot perform the assignment, it raises an exception \item If the target is a subscription: The primary expression in the reference is evaluated. It should yield either a mutable sequence -object (e.g., a list) or a mapping object (e.g., a dictionary). Next, +object (such as a list) or a mapping object (such as a dictionary). Next, the subscript expression is evaluated. \indexii{subscription}{assignment} \obindex{mutable} -If the primary is a mutable sequence object (e.g., a list), the subscript +If the primary is a mutable sequence object (such as a list), the subscript must yield a plain integer. If it is negative, the sequence's length is added to it. The resulting value must be a nonnegative integer less than the sequence's length, and the sequence is asked to assign @@ -219,7 +219,7 @@ sequence cannot add new items to a list). \obindex{sequence} \obindex{list} -If the primary is a mapping object (e.g., a dictionary), the subscript must +If the primary is a mapping object (such as a dictionary), the subscript must have a type compatible with the mapping's key type, and the mapping is then asked to create a key/datum pair which maps the subscript to the assigned object. This can either replace an existing key/value @@ -230,7 +230,7 @@ key with the same value existed). \item If the target is a slicing: The primary expression in the reference is -evaluated. It should yield a mutable sequence object (e.g., a list). The +evaluated. It should yield a mutable sequence object (such as a list). The assigned object should be a sequence object of the same type. Next, the lower and upper bound expressions are evaluated, insofar they are present; defaults are zero and the sequence's length. The bounds @@ -251,7 +251,7 @@ during the code generation phase, causing less detailed error messages.) WARNING: Although the definition of assignment implies that overlaps -between the left-hand side and the right-hand side are `safe' (e.g., +between the left-hand side and the right-hand side are `safe' (for example \samp{a, b = b, a} swaps two variables), overlaps \emph{within} the collection of assigned-to variables are not safe! For instance, the following program prints \samp{[0, 2]}: @@ -523,8 +523,9 @@ from __future__ import generators \end{productionlist} If no expressions are present, \keyword{raise} re-raises the last -expression that was active in the current scope. If no exception is -active in the current scope, an exception is raised indicating this error. +exception that was active in the current scope. If no exception is +active in the current scope, a \exception{Queue.Empty} exception is +raised indicating this error. \index{exception} \indexii{raising}{exception} |