Skip to content

Commit

Permalink
docutils: Address feeback by Jelle
Browse files Browse the repository at this point in the history
  • Loading branch information
not-my-profile committed Feb 21, 2022
1 parent 4f35202 commit 72c48e1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions stubs/docutils/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ docutils.parsers.rst.Directive.__getattr__
docutils.transforms.Transform.__getattr__
docutils.transforms.Transformer.__getattr__
docutils.utils.Reporter.__getattr__

# the constructor appears to be mostly internal API, public API users are meant to use docutils.utils.new_reporter instead
docutils.utils.Reporter.__init__
4 changes: 2 additions & 2 deletions stubs/docutils/docutils/languages/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any
from typing import Any, Protocol

from docutils.utils import Reporter

class _LanguageModule:
class _LanguageModule(Protocol):
labels: dict[str, str]
author_separators: list[str]
bibliographic_fields: list[str]
Expand Down
6 changes: 3 additions & 3 deletions stubs/docutils/docutils/parsers/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from typing import Any, ClassVar

from docutils import Component
from docutils.nodes import document
from docutils.nodes import document as _document

class Parser(Component):
component_type: ClassVar[str]
config_section: ClassVar[str]
inputstring: Any # defined after call to setup_parse()
document: Any # defined after call to setup_parse()
def parse(self, inputstring: str, document: document) -> None: ...
def setup_parse(self, inputstring: str, document: document) -> None: ...
def parse(self, inputstring: str, document: _document) -> None: ...
def setup_parse(self, inputstring: str, document: _document) -> None: ...
def finish_parse(self) -> None: ...

_parser_aliases: dict[str, str]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ from docutils.utils import SystemMessage
def register_directive(name: str, directive: type[Directive]) -> None: ...
def directive(
directive_name: str, language_module: _LanguageModule, document: document
) -> tuple[type[Directive], list[SystemMessage]]: ...
) -> tuple[type[Directive] | None, list[SystemMessage]]: ...
def __getattr__(name: str) -> Any: ... # incomplete

0 comments on commit 72c48e1

Please sign in to comment.