From ed5f3b191f3cdd00c235a83659c45a196c83e48f Mon Sep 17 00:00:00 2001 From: Stefano Borini Date: Sat, 26 Sep 2020 17:38:24 +0100 Subject: [PATCH] PEP 637: Removed Ellipsis rule -- '...' is just an expression already (#1623) --- pep-0637.rst | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pep-0637.rst b/pep-0637.rst index efe61107d..f0b0e28bb 100644 --- a/pep-0637.rst +++ b/pep-0637.rst @@ -413,12 +413,7 @@ The following old semantics are preserved: This may open up the possibility to accept the same syntax for general function calls, but this is not part of this recommendation. -11. Keyword arguments must allow Ellipsis:: - - obj[..., spam=..., eggs=2] - # calls type(obj).__getitem__(obj, Ellipsis, spam=Ellipsis, eggs=2) - -12. Keyword arguments allow for default values:: +11. Keyword arguments allow for default values:: # Given type(obj).__getitem__(obj, index, spam=True, eggs=2) obj[3] # Valid. index = 3, spam = True, eggs = 2 @@ -426,7 +421,7 @@ The following old semantics are preserved: obj[spam=False] # Valid. index = (), spam = False, eggs = 2 obj[] # Invalid. -13. The same semantics given above must be extended to ``__class__getitem__``: +12. The same semantics given above must be extended to ``__class__getitem__``: Since PEP 560, type hints are dispatched so that for ``x[y]``, if no ``__getitem__`` method is found, and ``x`` is a type (class) object, and ``x`` has a class method ``__class_getitem__``, that method is