mirror of https://github.com/python/cpython
SF bug #1190451: 6.9 First sentence is confusing
* Fixed incorrect wording: expression->exception * Noted the specific exception reported by "raise" when the is nothing to re-raise. * Eliminated several instances of "e.g." as recommended in the style guide.
This commit is contained in:
parent
e8dead47e6
commit
b56b494bea
|
@ -204,12 +204,12 @@ attribute; if it cannot perform the assignment, it raises an exception
|
||||||
\item
|
\item
|
||||||
If the target is a subscription: The primary expression in the
|
If the target is a subscription: The primary expression in the
|
||||||
reference is evaluated. It should yield either a mutable sequence
|
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.
|
the subscript expression is evaluated.
|
||||||
\indexii{subscription}{assignment}
|
\indexii{subscription}{assignment}
|
||||||
\obindex{mutable}
|
\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
|
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
|
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
|
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{sequence}
|
||||||
\obindex{list}
|
\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
|
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
|
then asked to create a key/datum pair which maps the subscript to
|
||||||
the assigned object. This can either replace an existing key/value
|
the assigned object. This can either replace an existing key/value
|
||||||
|
@ -230,7 +230,7 @@ key with the same value existed).
|
||||||
|
|
||||||
\item
|
\item
|
||||||
If the target is a slicing: The primary expression in the reference is
|
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,
|
assigned object should be a sequence object of the same type. Next,
|
||||||
the lower and upper bound expressions are evaluated, insofar they are
|
the lower and upper bound expressions are evaluated, insofar they are
|
||||||
present; defaults are zero and the sequence's length. The bounds
|
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.)
|
messages.)
|
||||||
|
|
||||||
WARNING: Although the definition of assignment implies that overlaps
|
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
|
\samp{a, b = b, a} swaps two variables), overlaps \emph{within} the
|
||||||
collection of assigned-to variables are not safe! For instance, the
|
collection of assigned-to variables are not safe! For instance, the
|
||||||
following program prints \samp{[0, 2]}:
|
following program prints \samp{[0, 2]}:
|
||||||
|
@ -523,8 +523,9 @@ from __future__ import generators
|
||||||
\end{productionlist}
|
\end{productionlist}
|
||||||
|
|
||||||
If no expressions are present, \keyword{raise} re-raises the last
|
If no expressions are present, \keyword{raise} re-raises the last
|
||||||
expression that was active in the current scope. If no exception is
|
exception that was active in the current scope. If no exception is
|
||||||
active in the current scope, an exception is raised indicating this error.
|
active in the current scope, a \exception{Queue.Empty} exception is
|
||||||
|
raised indicating this error.
|
||||||
\index{exception}
|
\index{exception}
|
||||||
\indexii{raising}{exception}
|
\indexii{raising}{exception}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue