diff options
author | Guido van Rossum <guido@python.org> | 2006-05-02 19:47:52 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-05-02 19:47:52 (GMT) |
commit | da5b701aeef755f2317a41e36cc950cfdc0c95cb (patch) | |
tree | 11a37e4e8714ffbccce921aa0ef1878b7dc779b2 /Doc/ref/ref7.tex | |
parent | 8f6cbe150228f175b57b7a774d0a630febe72244 (diff) | |
download | cpython-da5b701aeef755f2317a41e36cc950cfdc0c95cb.zip cpython-da5b701aeef755f2317a41e36cc950cfdc0c95cb.tar.gz cpython-da5b701aeef755f2317a41e36cc950cfdc0c95cb.tar.bz2 |
Get rid of __context__, per the latest changes to PEP 343 and python-dev
discussion.
There are two places of documentation that still mention __context__:
Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without
spending a whole lot of time thinking about it; and whatsnew, which Andrew
usually likes to change himself.
Diffstat (limited to 'Doc/ref/ref7.tex')
-rw-r--r-- | Doc/ref/ref7.tex | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Doc/ref/ref7.tex b/Doc/ref/ref7.tex index 4453e87..4a23133 100644 --- a/Doc/ref/ref7.tex +++ b/Doc/ref/ref7.tex @@ -322,21 +322,18 @@ be encapsulated for convenient reuse. \begin{productionlist} \production{with_stmt} - {"with" \token{expression} ["as" target_list] ":" \token{suite}} + {"with" \token{expression} ["as" target] ":" \token{suite}} \end{productionlist} The execution of the \keyword{with} statement proceeds as follows: \begin{enumerate} -\item The context expression is evaluated, to obtain a context manager. +\item The context expression is evaluated to obtain a context manager. -\item The context manger's \method{__context__()} method is -invoked to obtain a \keyword{with} statement context object. +\item The context manager's \method{__enter__()} method is invoked. -\item The context object's \method{__enter__()} method is invoked. - -\item If a target list was included in the \keyword{with} +\item If a target was included in the \keyword{with} statement, the return value from \method{__enter__()} is assigned to it. \note{The \keyword{with} statement guarantees that if the @@ -347,7 +344,7 @@ an error occurring within the suite would be. See step 6 below.} \item The suite is executed. -\item The context object's \method{__exit__()} method is invoked. If +\item The context manager's \method{__exit__()} method is invoked. If an exception caused the suite to be exited, its type, value, and traceback are passed as arguments to \method{__exit__()}. Otherwise, three \constant{None} arguments are supplied. |