From 821c765991a32f6fb40b0a52029986db45de06e8 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 17 Nov 2017 15:15:40 -0800 Subject: [PATCH] Several packages always auto-import certain submodules on import (#1752) * Importing yaml implies yaml.resolver * Importing six implies six.moves * Importing requests implies requests.packages --- third_party/2/six/__init__.pyi | 1 + third_party/2and3/requests/__init__.pyi | 1 + third_party/2and3/yaml/__init__.pyi | 1 + third_party/3/six/__init__.pyi | 1 + 4 files changed, 4 insertions(+) diff --git a/third_party/2/six/__init__.pyi b/third_party/2/six/__init__.pyi index bd8d97a37..990e1d1a1 100644 --- a/third_party/2/six/__init__.pyi +++ b/third_party/2/six/__init__.pyi @@ -15,6 +15,7 @@ from mypy_extensions import NoReturn from __builtin__ import unichr as unichr from StringIO import StringIO as StringIO, StringIO as BytesIO from functools import wraps as wraps +from . import moves _T = TypeVar('_T') diff --git a/third_party/2and3/requests/__init__.pyi b/third_party/2and3/requests/__init__.pyi index a89d4a078..97b540572 100644 --- a/third_party/2and3/requests/__init__.pyi +++ b/third_party/2and3/requests/__init__.pyi @@ -6,6 +6,7 @@ from . import api from . import sessions from . import status_codes from . import exceptions +from . import packages import logging __title__ = ... # type: Any diff --git a/third_party/2and3/yaml/__init__.pyi b/third_party/2and3/yaml/__init__.pyi index 102bc353b..9c6c197fe 100644 --- a/third_party/2and3/yaml/__init__.pyi +++ b/third_party/2and3/yaml/__init__.pyi @@ -5,6 +5,7 @@ from yaml.events import * # noqa: F403 from yaml.nodes import * # noqa: F403 from yaml.loader import * # noqa: F403 from yaml.dumper import * # noqa: F403 +from . import resolver # Help mypy a bit; this is implied by loader and dumper # TODO: stubs for cyaml? # from cyaml import * diff --git a/third_party/3/six/__init__.pyi b/third_party/3/six/__init__.pyi index 4c926a962..4691daacb 100644 --- a/third_party/3/six/__init__.pyi +++ b/third_party/3/six/__init__.pyi @@ -29,6 +29,7 @@ from mypy_extensions import NoReturn from io import StringIO as StringIO, BytesIO as BytesIO from builtins import next as next from functools import wraps as wraps +from . import moves _T = TypeVar('_T') _K = TypeVar('_K')