Merge pull request #5873 from tk0miya/fix_typehints_for_autosummary

Update annotations for autosummary
This commit is contained in:
Takeshi KOMIYA 2019-01-02 16:45:48 +09:00 committed by GitHub
commit 860d7ab506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -552,12 +552,12 @@ def limited_join(sep, items, max_chars=30, overflow_marker="..."):
# -- Importing items ----------------------------------------------------------- # -- Importing items -----------------------------------------------------------
def get_import_prefixes_from_env(env): def get_import_prefixes_from_env(env):
# type: (BuildEnvironment) -> List # type: (BuildEnvironment) -> List[str]
""" """
Obtain current Python import prefixes (for `import_by_name`) Obtain current Python import prefixes (for `import_by_name`)
from ``document.env`` from ``document.env``
""" """
prefixes = [None] # type: List prefixes = [None] # type: List[str]
currmodule = env.ref_context.get('py:module') currmodule = env.ref_context.get('py:module')
if currmodule: if currmodule:
@ -574,7 +574,7 @@ def get_import_prefixes_from_env(env):
def import_by_name(name, prefixes=[None]): def import_by_name(name, prefixes=[None]):
# type: (str, List) -> Tuple[str, Any, Any, str] # type: (str, List[str]) -> Tuple[str, Any, Any, str]
"""Import a Python object that has the given *name*, under one of the """Import a Python object that has the given *name*, under one of the
*prefixes*. The first name that succeeds is used. *prefixes*. The first name that succeeds is used.
""" """