From 97737ce8c21f0b8e6ed3d6595c46d2df882c3a8a Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 3 Jul 2017 19:01:19 +0200 Subject: [PATCH] Add collections import in typing for type aliases to always work (#1456) * Add collections import in typing for type aliases to always work * Add mypy issue number to the comment --- 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 747bfa4e9..84cd0d455 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, 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 7ec86a1ac..b8d732749 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, see mypy issue 2986 # Definitions of special type checking related constructs. Their definition # are not used, so their value does not matter.