Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Wrap long line
Co-authored-by: Ezio Melotti <[email protected]>
  • Loading branch information
slateny and ezio-melotti authored Sep 22, 2022
commit e110dd13f361c5e8a5d764b2fa9af74b23f97b48
3 changes: 2 additions & 1 deletion Doc/faq/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ Why don't generators support the with statement?
For technical reasons, a generator used directly as a context manager
would not work correctly. When, as is most common, a generator is used as
an iterator run to completion, no closing is needed. When it is, wrap
it as :func:`contextlib.closing(generator) <contextlib.closing>` in the :keyword:`with` statement.
it as :func:`contextlib.closing(generator) <contextlib.closing>`
in the :keyword:`with` statement.


Why are colons required for the if/while/def/class statements?
Expand Down