From 8a0ee7c01d75aef12fd5e6e5aca256d703364ba9 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Fri, 27 Jan 2017 22:35:57 +0100 Subject: [PATCH 1/2] PEP 484: add an example of iterable unpacking with type comments --- pep-0484.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pep-0484.txt b/pep-0484.txt index 8490e3d899b..6c0f5c48165 100644 --- a/pep-0484.txt +++ b/pep-0484.txt @@ -1367,9 +1367,10 @@ No first-class syntax support for explicitly marking variables as being of a specific type is added by this PEP. To help with type inference in complex cases, a comment of the following format may be used:: - x = [] # type: List[Employee] + x = [] # type: List[Employee] x, y, z = [], [], [] # type: List[int], List[int], List[str] x, y, z = [], [], [] # type: (List[int], List[int], List[str]) + a, b, *c = range(5) # type: float, float, List[float] x = [ 1, 2, From 0cae64e19c50c83041ffbe99bad2aa99a09f77fb Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Fri, 27 Jan 2017 22:38:16 +0100 Subject: [PATCH 2/2] Formatting --- pep-0484.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pep-0484.txt b/pep-0484.txt index 6c0f5c48165..34595d86294 100644 --- a/pep-0484.txt +++ b/pep-0484.txt @@ -1370,7 +1370,7 @@ complex cases, a comment of the following format may be used:: x = [] # type: List[Employee] x, y, z = [], [], [] # type: List[int], List[int], List[str] x, y, z = [], [], [] # type: (List[int], List[int], List[str]) - a, b, *c = range(5) # type: float, float, List[float] + a, b, *c = range(5) # type: float, float, List[float] x = [ 1, 2,