8000 remove generic 'context' from 'docutils.parsers.rst.RSTState' (#12291) · python/typeshed@5305de8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5305de8

Browse files
authored
remove generic 'context' from 'docutils.parsers.rst.RSTState' (#12291)
1 parent 7c26da2 commit 5305de8

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

stubs/docutils/docutils/parsers/rst/__init__.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Parser(parsers.Parser):
1212
settings_spec: ClassVar[Incomplete]
1313
config_section_dependencies: ClassVar[tuple[str, ...]]
1414
initial_state: Literal["Body", "RFC2822Body"]
15-
state_classes: Sequence[type[RSTState[Incomplete]]]
15+
state_classes: Sequence[type[RSTState]]
1616
inliner: Inliner | None
1717
def __init__(self, rfc2822: bool = False, inliner: Inliner | None = None) -> None: ...
1818
def get_transforms(self) -> list[type[Transform]]: ...
@@ -36,7 +36,7 @@ class Directive:
3636
lineno: int
3737
content_offset: int
3838
block_text: str
39-
state: RSTState[Incomplete]
39+
state: RSTState
4040
state_machine: RSTStateMachine = ...
4141
def __init__(
4242
self,
@@ -47,7 +47,7 @@ class Directive:
4747
lineno: int,
4848
content_offset: int,
4949
block_text: str,
50-
state: RSTState[Incomplete],
50+
state: RSTState,
5151
state_machine: RSTStateMachine,
5252
) -> None: ...
5353
def run(self) -> Sequence[nodes.Node]: ...
@@ -61,7 +61,7 @@ class Directive:
6161
def add_name(self, node: nodes.Node) -> None: ...
6262

6363
_DirectiveFn: TypeAlias = Callable[
64-
[str, list[str], dict[str, Any], StringList, int, int, str, RSTState[Incomplete], RSTStateMachine], Directive
64+
[str, list[str], dict[str, Any], StringList, int, int, str, RSTState, RSTStateMachine], Directive
6565
]
6666

6767
def convert_directive_function(directive_fn: _DirectiveFn) -> type[Directive]: ...

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@ from _typeshed import Incomplete
22
from collections.abc import Callable, Sequence
33
from re import Match, Pattern
44
from types import ModuleType
5-
from typing import Any, TypeVar
5+
from typing import Any
66
from typing_extensions import TypeAlias
77

88
from docutils import nodes
99
from docutils.statemachine import StateMachineWS, StateWS
1010
from docutils.utils import Reporter
1111

12-
_Context = TypeVar("_Context")
13-
1412
class Struct:
1513
def __init__(self, **keywordargs) -> None: ...
1614

17-
class RSTState(StateWS[_Context]):
18-
nested_sm: type[StateMachineWS[_Context]]
15+
class RSTState(StateWS[list[str]]):
16+
nested_sm: type[StateMachineWS[list[str]]]
1917
nested_sm_cache: Incomplete
2018
nested_sm_kwargs: Incomplete
2119
def __init__(self, state_machine, debug: bool = False) -> None: ...

0 commit comments

Comments
 (0)
0