PEP 484: Clarify that 'import ... as ...' means 'X as X' (#1630)

This commit is contained in:
Guido van Rossum 2020-09-30 19:46:20 -07:00 committed by GitHub
parent f86dbb0f41
commit 0f7f6400a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1651,6 +1651,9 @@ Additional notes on stub files:
* Modules and variables imported into the stub are not considered
exported from the stub unless the import uses the ``import ... as
...`` form or the equivalent ``from ... import ... as ...`` form.
(*UPDATE:* To clarify, the intention here is that only names
imported using the form ``X as X`` will be exported, i.e. the name
before and after ``as`` must be the same.)
* However, as an exception to the previous bullet, all objects
imported into a stub using ``from ... import *`` are considered