Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3b675d29
Commit
3b675d29
authored
Apr 20, 2006
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change a footnote to a parenthetical (in two senses) paragraph
parent
af015cfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Doc/whatsnew/whatsnew25.tex
Doc/whatsnew/whatsnew25.tex
+8
-5
No files found.
Doc/whatsnew/whatsnew25.tex
View file @
3b675d29
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment