[Python-checkins] peps: pep-0492: Update Rationale section
yury.selivanov
python-checkins at python.org
Tue May 5 01:35:39 CEST 2015
https://hg.python.org/peps/rev/6d958eafdd28
changeset: 5821:6d958eafdd28
user: Yury Selivanov <yselivanov at sprymix.com>
date: Mon May 04 19:35:36 2015 -0400
summary:
pep-0492: Update Rationale section
files:
pep-0492.txt | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/pep-0492.txt b/pep-0492.txt
--- a/pep-0492.txt
+++ b/pep-0492.txt
@@ -38,15 +38,15 @@
342), further enhanced by the ``yield from`` syntax introduced in PEP
380. This approach has a number of shortcomings:
-* it is easy to confuse coroutines with regular generators, since they
- share the same syntax; async libraries often attempt to alleviate
- this by using decorators (e.g. ``@asyncio.coroutine`` [1]_);
+* It is easy to confuse coroutines with regular generators, since they
+ share the same syntax; this is especially true for new developers.
-* it is not possible to natively define a coroutine which has no
- ``yield`` or ``yield from`` statements, again requiring the use of
- decorators to fix potential refactoring issues;
+* Whether or not a function is a coroutine is determined by a presence
+ of ``yield`` or ``yield from`` statements in its *body*, which can
+ lead to unobvious errors when such statements appear in or disappear
+ from function body during refactoring.
-* support for asynchronous calls is limited to expressions where
+* Support for asynchronous calls is limited to expressions where
``yield`` is allowed syntactically, limiting the usefulness of
syntactic features, such as ``with`` and ``for`` statements.
--
Repository URL: https://hg.python.org/peps
More information about the Python-checkins
mailing list