diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-30 17:33:52 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-30 17:33:52 +0900 |
commit | 0355d57fc1159312a131b2e44acb4a0240b2de4e (patch) | |
tree | 225b6c5f9904d8699332add3cb0939fb8be68ef2 /sphinx/application.py | |
parent | 7a4bbf372a470700a1dfd96dd57054bb96b92fd3 (diff) | |
parent | ab184ac20d82d0546c21f33d2fdfbfb324078d56 (diff) | |
download | sphinx-git-0355d57fc1159312a131b2e44acb4a0240b2de4e.tar.gz |
Merge pull request #6972 from tk0miya/refactor_type_annotation2
mypy: Enable disallow_incomplete_defs flag for type checking
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index 975dc2a70..0520bc6f7 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -438,7 +438,7 @@ class Sphinx: logger.debug('[app] disconnecting event: [id=%s]', listener_id) self.events.disconnect(listener_id) - def emit(self, event: str, *args) -> List: + def emit(self, event: str, *args: Any) -> List: """Emit *event* and pass *arguments* to the callback functions. Return the return values of all callbacks as a list. Do not emit core @@ -446,7 +446,7 @@ class Sphinx: """ return self.events.emit(event, *args) - def emit_firstresult(self, event: str, *args) -> Any: + def emit_firstresult(self, event: str, *args: Any) -> Any: """Emit *event* and pass *arguments* to the callback functions. Return the result of the first callback that doesn't return ``None``. @@ -524,7 +524,8 @@ class Sphinx: """ self.registry.add_translator(name, translator_class, override=override) - def add_node(self, node: "Type[Element]", override: bool = False, **kwds) -> None: + def add_node(self, node: "Type[Element]", override: bool = False, + **kwds: Tuple[Callable, Callable]) -> None: """Register a Docutils node class. This is necessary for Docutils internals. It may also be used in the @@ -564,7 +565,7 @@ class Sphinx: def add_enumerable_node(self, node: "Type[Element]", figtype: str, title_getter: TitleGetter = None, override: bool = False, - **kwds) -> None: + **kwds: Tuple[Callable, Callable]) -> None: """Register a Docutils node class as a numfig target. Sphinx numbers the node automatically. And then the users can refer it @@ -600,7 +601,7 @@ class Sphinx: def add_directive(self, name: str, obj: Any, content: bool = None, arguments: Tuple[int, int, bool] = None, override: bool = False, - **options) -> None: + **options: Any) -> None: """Register a Docutils directive. *name* must be the prospective directive name. There are two possible @@ -729,7 +730,7 @@ class Sphinx: def add_directive_to_domain(self, domain: str, name: str, obj: Any, has_content: bool = None, argument_spec: Any = None, - override: bool = False, **option_spec) -> None: + override: bool = False, **option_spec: Any) -> None: """Register a Docutils directive in a domain. Like :meth:`add_directive`, but the directive is added to the domain @@ -1099,7 +1100,7 @@ class Sphinx: """ self.registry.add_source_suffix(suffix, filetype, override=override) - def add_source_parser(self, *args, **kwargs) -> None: + def add_source_parser(self, *args: Any, **kwargs: Any) -> None: """Register a parser class. .. versionadded:: 1.4 |