PEP 614: Final (#1437)

This commit is contained in:
Brandt Bucher 2020-06-18 18:31:22 -07:00 committed by GitHub
parent a34d674365
commit 89d5db95cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions

View File

@ -4,13 +4,13 @@ Version: $Revision$
Last-Modified: $Date$ Last-Modified: $Date$
Author: Brandt Bucher <brandtbucher@gmail.com> Author: Brandt Bucher <brandtbucher@gmail.com>
Sponsor: Guido van Rossum <guido@python.org> Sponsor: Guido van Rossum <guido@python.org>
Status: Accepted Status: Final
Type: Standards Track Type: Standards Track
Content-Type: text/x-rst Content-Type: text/x-rst
Created: 10-Feb-2020 Created: 10-Feb-2020
Python-Version: 3.9 Python-Version: 3.9
Post-History: 11-Feb-2020 Post-History: 11-Feb-2020, 18-Feb-2020, 03-Mar-2020
Resolution: Resolution: https://mail.python.org/archives/list/python-dev@python.org/thread/VSR66MOTCDCY7ZFH4IG7QVFI2JXQQZQ5
Abstract Abstract
@ -27,7 +27,7 @@ Motivation
When decorators were first being introduced, `Guido described When decorators were first being introduced, `Guido described
<https://mail.python.org/archives/list/python-dev@python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7>`_ <https://mail.python.org/archives/list/python-dev@python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7>`_
the motivation to limit their syntax as a preference, not a technical the motivation to limit their syntax as a preference, not a technical
requirement: requirement:
I have a gut feeling about this one. I'm not sure where it comes I have a gut feeling about this one. I'm not sure where it comes
from, but I have it... So while it would be quite easy to change from, but I have it... So while it would be quite easy to change
@ -48,7 +48,7 @@ would become more readable, idiomatic, and maintainable if the
existing restrictions were relaxed. Slightly modified:: existing restrictions were relaxed. Slightly modified::
buttons = [QPushButton(f'Button {i}') for i in range(10)] buttons = [QPushButton(f'Button {i}') for i in range(10)]
# Do stuff with the list of buttons... # Do stuff with the list of buttons...
@buttons[0].clicked.connect @buttons[0].clicked.connect
@ -58,7 +58,7 @@ existing restrictions were relaxed. Slightly modified::
@buttons[1].clicked.connect @buttons[1].clicked.connect
def eggs(): def eggs():
... ...
# Do stuff with the list of buttons... # Do stuff with the list of buttons...
Currently, these decorations must be rewritten as something like:: Currently, these decorations must be rewritten as something like::
@ -167,7 +167,7 @@ Named Expressions *Need Not* Be Parenthesized
Here, the the choice of syntax is unambiguous. :pep:`572` explains Here, the the choice of syntax is unambiguous. :pep:`572` explains
why it requires parentheses around top-level expression statements: why it requires parentheses around top-level expression statements:
This rule is included to simplify the choice for the user between This rule is included to simplify the choice for the user between
an assignment statement and an assignment expression -- there is an assignment statement and an assignment expression -- there is
no syntactic position where both are valid. no syntactic position where both are valid.
@ -205,8 +205,8 @@ exists.
Reference Implementation Reference Implementation
======================== ========================
The author has drafted a CPython implementation, which can be found on The author has written a `CPython implementation
`GitHub <https://github.com/brandtbucher/cpython/tree/decorators>`_. <https://github.com/python/cpython/pull/18570>`_.
Copyright Copyright