Don't have quite so many top level headings
This commit is contained in:
parent
8257981ad1
commit
4c2e982b75
37
pep-0403.txt
37
pep-0403.txt
|
@ -139,9 +139,21 @@ would be equivalent to::
|
||||||
def name():
|
def name():
|
||||||
...
|
...
|
||||||
|
|
||||||
|
Syntax Change
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Syntactically, only one new grammar rule is needed::
|
||||||
|
|
||||||
|
in_stmt: '@in' simple_stmt decorated
|
||||||
|
|
||||||
|
Grammar: http://hg.python.org/cpython/file/default/Grammar/Grammar
|
||||||
|
|
||||||
|
|
||||||
|
Design Discussion
|
||||||
|
=================
|
||||||
|
|
||||||
Background
|
Background
|
||||||
==========
|
----------
|
||||||
|
|
||||||
The question of "multi-line lambdas" has been a vexing one for many
|
The question of "multi-line lambdas" has been a vexing one for many
|
||||||
Python users for a very long time, and it took an exploration of Ruby's
|
Python users for a very long time, and it took an exploration of Ruby's
|
||||||
|
@ -185,7 +197,7 @@ decorators, but covering a broader set of applications.
|
||||||
|
|
||||||
|
|
||||||
Relation to PEP 3150
|
Relation to PEP 3150
|
||||||
====================
|
--------------------
|
||||||
|
|
||||||
PEP 3150 (Statement Local Namespaces) described its primary motivation
|
PEP 3150 (Statement Local Namespaces) described its primary motivation
|
||||||
as being to elevate ordinary assignment statements to be on par with ``class``
|
as being to elevate ordinary assignment statements to be on par with ``class``
|
||||||
|
@ -203,7 +215,7 @@ actual name binding in the current scope.
|
||||||
|
|
||||||
|
|
||||||
Keyword Choice
|
Keyword Choice
|
||||||
==============
|
--------------
|
||||||
|
|
||||||
The proposal definitely requires *some* kind of prefix to avoid parsing
|
The proposal definitely requires *some* kind of prefix to avoid parsing
|
||||||
ambiguity and backwards compatibility problems with existing constructs.
|
ambiguity and backwards compatibility problems with existing constructs.
|
||||||
|
@ -227,13 +239,14 @@ but the concept remains the same.
|
||||||
|
|
||||||
|
|
||||||
Better Debugging Support for Functions and Classes with Short Names
|
Better Debugging Support for Functions and Classes with Short Names
|
||||||
===================================================================
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
One of the objections to widespread use of lambda expressions is that they
|
One of the objections to widespread use of lambda expressions is that they
|
||||||
have a negative effect on traceback intelligibility and other aspects of
|
have a negative effect on traceback intelligibility and other aspects of
|
||||||
introspection. Similarly objections are raised regarding constructs that
|
introspection. Similar objections are raised regarding constructs that
|
||||||
promote short, cryptic function names (including this one, which requires
|
promote short, cryptic function names (including this one, which requires
|
||||||
that the name of the trailing definition be supplied at least twice)
|
that the name of the trailing definition be supplied at least twice,
|
||||||
|
encouraging the use of shorthand placeholder names like ``f``).
|
||||||
|
|
||||||
However, the introduction of qualified names in PEP 3155 means that even
|
However, the introduction of qualified names in PEP 3155 means that even
|
||||||
anonymous classes and functions will now have different representations if
|
anonymous classes and functions will now have different representations if
|
||||||
|
@ -250,18 +263,8 @@ will still share representations (aside from the object ID), but this is
|
||||||
still a major improvement over the historical situation where everything
|
still a major improvement over the historical situation where everything
|
||||||
*except* the object ID was identical.
|
*except* the object ID was identical.
|
||||||
|
|
||||||
Syntax Change
|
|
||||||
=============
|
|
||||||
|
|
||||||
Syntactically, only one new grammar rule is needed::
|
|
||||||
|
|
||||||
in_stmt: '@in' simple_stmt decorated
|
|
||||||
|
|
||||||
Grammar: http://hg.python.org/cpython/file/default/Grammar/Grammar
|
|
||||||
|
|
||||||
|
|
||||||
Possible Implementation Strategy
|
Possible Implementation Strategy
|
||||||
================================
|
--------------------------------
|
||||||
|
|
||||||
This proposal has at least one titanic advantage over PEP 3150:
|
This proposal has at least one titanic advantage over PEP 3150:
|
||||||
implementation should be relatively straightforward.
|
implementation should be relatively straightforward.
|
||||||
|
|
Loading…
Reference in New Issue