Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pep-0484.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,19 @@ Additional notes on stub files:
exported. (This makes it easier to re-export all objects from a
given module that may vary by Python version.)

* Just like in normal Python files [importdocs]_, submodules
automatically become exported attributes of their parent module
when imported. For example, if the ``spam`` package has the
following directory structure::

spam/
__init__.pyi
ham.pyi

where ``__init__.pyi`` contains a line such as ``from . import ham``
or ``from .ham import Ham``, then ``ham`` is an exported attribute
of ``spam``.

* Stub files may be incomplete. To make type checkers aware of this, the file
can contain the following code::

Expand Down Expand Up @@ -2457,6 +2470,9 @@ References
.. [peps]
https://hg.python.org/peps/file/tip/pep-0484.txt

.. [importdocs]
https://docs.python.org/3/reference/import.html#submodules


Copyright
=========
Expand Down