PEP 612: Guido as sponsor, and two minor edits (#1301)

This commit is contained in:
Guido van Rossum 2020-02-06 21:18:37 -08:00 committed by GitHub
parent 7f402aef96
commit 0fcb222a7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
PEP: 612 PEP: 612
Title: Parameter Specification Variables Title: Parameter Specification Variables
Author: Mark Mendoza <mendoza.mark.a@gmail.com> Author: Mark Mendoza <mendoza.mark.a@gmail.com>
Sponsor: Guido van Rossum <guido@python.org>
Discussions-To: Typing-Sig <typing-sig@python.org> Discussions-To: Typing-Sig <typing-sig@python.org>
Status: Draft Status: Draft
Type: Standards Track Type: Standards Track
@ -162,7 +163,7 @@ evaluating ones with ``TypeVar``\ s.
f = foo(bar) # f should be inferred to have the same signature as bar, f = foo(bar) # f should be inferred to have the same signature as bar,
# but returning str # but returning str
f("A", True) # Accepted f("A", True) # Accepted
f(a = "A", b = True) # Accepted f(a="A", b=True) # Accepted
f("A", "A") # Rejected f("A", "A") # Rejected
Just as with traditional ``TypeVars``\ , a user may include the same Just as with traditional ``TypeVars``\ , a user may include the same
@ -194,8 +195,8 @@ Use in ``Generic`` Classes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Just as with normal ``TypeVar``\ s, ``ParameterSpecification``\ s can be used to Just as with normal ``TypeVar``\ s, ``ParameterSpecification``\ s can be used to
make generic classes as well as generic functions. These ought to be able to be make generic classes as well as generic functions. These are able to be
mixed with normal ``TypeVar``\ s. This should also be made to work with mixed with normal ``TypeVar``\ s. This also work with
protocols in the same manner. protocols in the same manner.
The components of a ``ParameterSpecification`` The components of a ``ParameterSpecification``