34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
![]() |
=== On 2015-03-17T08:41:25Z Elena Vilchik Wrote:
|
||
|
\[~ann.campbell.2]
|
||
|
|
||
|
1. We should focus in rule description that "return" contains argument. "return" without argument can be used in generator.
|
||
|
|
||
|
2. About labels: may be we should create tag for syntax error, and to use it in all such python rules. For example "syntax". What do you think?
|
||
|
|
||
|
=== On 2015-03-17T17:48:41Z Ann Campbell Wrote:
|
||
|
\[~elena.vilchik] I've updated the description. See if it's enough.
|
||
|
|
||
|
|
||
|
I'm not wild about the proposed tag.
|
||
|
|
||
|
=== On 2019-11-27T14:52:09Z Nicolas Harraudeau Wrote:
|
||
|
Deprecating this rule because it is possible to use ``++return++`` in a generator since Python 3.3, which was released on September 29, 2012.
|
||
|
|
||
|
|
||
|
The following code:
|
||
|
|
||
|
----
|
||
|
return 42
|
||
|
----
|
||
|
is equivalent to
|
||
|
|
||
|
----
|
||
|
raise StopIteration(42)
|
||
|
----
|
||
|
|
||
|
See https://www.python.org/dev/peps/pep-0380/#formal-semantics[PEP 380] for more information.
|
||
|
|
||
|
|
||
|
Note also that https://www.python.org/doc/sunset-python-2/[official python 2 support will be stopped on January 1, 2020], thus there is no point in having this rule enabled by default.
|
||
|
|