From a7ed270af6b26df7c23fc6ed254133640e7d0730 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Sun, 2 Jul 2017 21:59:01 +0200 Subject: [PATCH 1/2] Add collections import in typing for type aliases to always work --- stdlib/2/typing.pyi | 1 + stdlib/3/typing.pyi | 1 + 2 files changed, 2 insertions(+) diff --git a/stdlib/2/typing.pyi b/stdlib/2/typing.pyi index 747bfa4e9847..e63b09a1c2d0 100644 --- a/stdlib/2/typing.pyi +++ b/stdlib/2/typing.pyi @@ -2,6 +2,7 @@ from abc import abstractmethod, ABCMeta from types import CodeType, FrameType, TracebackType +import collections # Needed by aliases like DefaultDict, Deque, etc. # Definitions of special type checking related constructs. Their definitions # are not used, so their value does not matter. diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index 7ec86a1ac389..0b5f7c88eef0 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -3,6 +3,7 @@ import sys from abc import abstractmethod, ABCMeta from types import CodeType, FrameType, TracebackType +import collections # Needed by aliases like DefaultDict, Deque, etc. # Definitions of special type checking related constructs. Their definition # are not used, so their value does not matter. From 8d11de0c9ef5fbff3201672a0b1e0d5049de1d5f Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 3 Jul 2017 09:57:22 +0200 Subject: [PATCH 2/2] Add mypy issue number to the comment --- stdlib/2/typing.pyi | 2 +- stdlib/3/typing.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2/typing.pyi b/stdlib/2/typing.pyi index e63b09a1c2d0..84cd0d4553ea 100644 --- a/stdlib/2/typing.pyi +++ b/stdlib/2/typing.pyi @@ -2,7 +2,7 @@ from abc import abstractmethod, ABCMeta from types import CodeType, FrameType, TracebackType -import collections # Needed by aliases like DefaultDict, Deque, etc. +import collections # Needed by aliases like DefaultDict, see mypy issue 2986 # Definitions of special type checking related constructs. Their definitions # are not used, so their value does not matter. diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index 0b5f7c88eef0..b8d7327499a0 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -3,7 +3,7 @@ import sys from abc import abstractmethod, ABCMeta from types import CodeType, FrameType, TracebackType -import collections # Needed by aliases like DefaultDict, Deque, etc. +import collections # Needed by aliases like DefaultDict, see mypy issue 2986 # Definitions of special type checking related constructs. Their definition # are not used, so their value does not matter.