Skip to content

Update __import__ function annotations - #3188

Merged
srittau merged 1 commit into
python:masterfrom
jdufresne:import
Aug 16, 2019
Merged

srittau merged 1 commit into
python:masterfrom
jdufresne:import

Conversation

@jdufresne

Copy link
Copy Markdown
Contributor

Per the docs, globals/locals is an optional argument.

https://docs.python.org/3/library/functions.html#__import__
https://docs.python.org/2/library/functions.html#__import__

Additionally, globals/locals can be any mapping type, not only a dict.

Likewise, fromlist can be any sequence (the docs mention a tuple, not a
list).

The function returns a ModuleType, not Any.

Now matches the definition in stdlib/3/importlib/init.pyi.

Per the docs, globals/locals is an optional argument.

https://docs.python.org/3/library/functions.html#__import__
https://docs.python.org/2/library/functions.html#__import__

Additionally, globals/locals can be any mapping type, not only a dict.

Likewise, fromlist can be any sequence (the docs mention a tuple, not a
list).

The function returns a ModuleType, not Any.

Now matches the definition in stdlib/3/importlib/__init__.pyi.

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants