8000 improve type annotations in 'docutils.parsers.rst.states' (#11545) · python/typeshed@694c982 · GitHub
[go: up one dir, main page]

Skip to content

Commit 694c982

Browse files
authored
improve type annotations in 'docutils.parsers.rst.states' (#11545)
1 parent f4dfa5a commit 694c982

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

stubs/docutils/docutils/parsers/rst/states.pyi

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from _typeshed import Incomplete
2-
from collections.abc import Callable, Sequence
2+
from collections.abc import Callable, Iterable, Sequence
33
from re import Match, Pattern
44
from types import ModuleType
55
from typing import Any
66
from typing_extensions import TypeAlias
77

88
from docutils import nodes
9-
from docutils.statemachine import StateMachineWS, StateWS
9+
from docutils.statemachine import StateMachine, StateMachineWS, StateWS
1010
from docutils.utils import Reporter
1111

1212
class Struct:
@@ -18,27 +18,27 @@ class RSTState(StateWS[list[str]]):
1818
nested_sm_kwargs: Incomplete
1919
def __init__(self, state_machine, debug: bool = False) -> None: ...
2020
memo: Incomplete
21-
reporter: Incomplete
22-
inliner: Incomplete
21+
reporter: Reporter
22+
inliner: Inliner
2323
document: nodes.document
2424
parent: Incomplete
2525
def runtime_init(self) -> None: ...
26-
def goto_line(self, abs_line_offset) -> None: ...
27-
def no_match(self, context, transitions): ...
28-
def bof(self, context): ...
26+
def goto_line(self, abs_line_offset: int) -> None: ...
27+
def no_match(self, context: list[str], transitions): ...
28+
def bof(self, context: list[str]): ...
2929
def nested_parse(
3030
self,
3131
block,
32-
input_offset,
32+
input_offset: int,
3333
node,
3434
match_titles: bool = False,
35-
state_machine_class: Incomplete | None = None,
35+
state_machine_class: type[StateMachine[list[str]]] | None = None,
3636
state_machine_kwargs: Incomplete | None = None,
3737
): ...
3838
def nested_list_parse(
3939
self,
4040
block,
41-
input_offset,
41+
input_offset: int,
4242
node,
4343
initial_state,
4444
blank_finish,
@@ -48,13 +48,13 @@ class RSTState(StateWS[list[str]]):
4848
state_machine_class: Incomplete | None = None,
4949
state_machine_kwargs: Incomplete | None = None,
5050
): ...
51-
def section(self, title, source, style, lineno, messages) -> None: ...
52-
def check_subsection(self, source, style, lineno): ...
53-
def title_inconsistent(self, sourcetext, lineno): ...
54-
def new_subsection(self, title, lineno, messages) -> None: ...
55-
def paragraph(self, lines, lineno): ...
56-
def inline_text(self, text, lineno): ...
57-
def unindent_warning(self, node_name): ...
51+
def section(self, title: str, source, style, lineno: int, messages) -> None: ...
52+
def check_subsection(self, source, style, lineno: int): ...
53+
def title_inconsistent(self, sourcetext: str, lineno: int): ...
54+
def new_subsection(self, title: str, lineno: int, messages) -> None: ...
55+
def paragraph(self, lines: Iterable[str], lineno: int): ...
56+
def inline_text(self, text: str, lineno: int): ...
57+
def unindent_warning(self, node_name: str): ...
5858

5959
def build_regexp(definition, compile: bool = True): ...
6060

0 commit comments

Comments
 (0)
0