From 51a178bcfb224550ce22f25e7ad375a89aeeea1a Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 14 Jul 2017 21:36:00 -0700 Subject: [PATCH] PEP 484: Clarify that submodules in a package are exported See discussion in https://github.com/python/typeshed/pull/1484#discussion_r127114355. cc @ilevkivskyi @gvanrossum --- pep-0484.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pep-0484.txt b/pep-0484.txt index de010de78c4..5d27af5c386 100644 --- a/pep-0484.txt +++ b/pep-0484.txt @@ -1657,7 +1657,10 @@ Additional notes on stub files: * However, as an exception to the previous bullet, all objects imported into a stub using ``from ... import *`` are considered exported. (This makes it easier to re-export all objects from a - given module that may vary by Python version.) + given module that may vary by Python version.) Similarly, imports + of submodules in the ``__init__.pyi`` files of a package are + considered exported. For example, if ``a/__init__.pyi`` contains + just ``from . import b``, then ``b`` is exported. * Stub files may be incomplete. To make type checkers aware of this, the file can contain the following code::