diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2006-04-20 13:43:21 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2006-04-20 13:43:21 (GMT) |
commit | 3b675d299c528272108dbdb1433ccfe9cbbf2ee1 (patch) | |
tree | a9953dff8e396ded9ae7d125587f5e9586e88523 /Doc/whatsnew/whatsnew25.tex | |
parent | af015cfcbf56a18a18d49b3226df467d50353a2c (diff) | |
download | cpython-3b675d299c528272108dbdb1433ccfe9cbbf2ee1.zip cpython-3b675d299c528272108dbdb1433ccfe9cbbf2ee1.tar.gz cpython-3b675d299c528272108dbdb1433ccfe9cbbf2ee1.tar.bz2 |
Change a footnote to a parenthetical (in two senses) paragraph
Diffstat (limited to 'Doc/whatsnew/whatsnew25.tex')
-rw-r--r-- | Doc/whatsnew/whatsnew25.tex | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Doc/whatsnew/whatsnew25.tex b/Doc/whatsnew/whatsnew25.tex index 33692a9..db6c25a 100644 --- a/Doc/whatsnew/whatsnew25.tex +++ b/Doc/whatsnew/whatsnew25.tex @@ -452,11 +452,14 @@ I recommend that you always put parentheses around a \keyword{yield} expression when you're doing something with the returned value, as in the above example. The parentheses aren't always necessary, but it's easier to always add them instead of having to remember when they're -needed.\footnote{The exact rules are that a \keyword{yield}-expression must -always be parenthesized except when it occurs at the top-level -expression on the right-hand side of an assignment, meaning you can -write \code{val = yield i} but have to use parentheses when there's an -operation, as in \code{val = (yield i) + 12}.} +needed. + +(\pep{342} explains the exact rules, which are that a +\keyword{yield}-expression must always be parenthesized except when it +occurs at the top-level expression on the right-hand side of an +assignment. This means you can write \code{val = yield i} but have to +use parentheses when there's an operation, as in \code{val = (yield i) ++ 12}.) Values are sent into a generator by calling its \method{send(\var{value})} method. The generator's code is then |