1
- from _typeshed import Incomplete
2
1
from collections .abc import Callable , Iterable , Mapping , Sequence
3
2
from re import Match , Pattern
4
3
from types import ModuleType
5
4
from typing import Any , ClassVar , Final , Literal , TypeVar , overload
6
- from typing_extensions import Never , TypeAlias
7
5
6
+ from _typeshed import Incomplete
8
7
from docutils import ApplicationError , DataError , nodes
9
8
from docutils .parsers .rst import Directive
10
9
from docutils .parsers .rst .languages import _RstLanguageModule
11
10
from docutils .parsers .rst .tableparser import TableParser
12
11
from docutils .statemachine import StateMachine , StateMachineWS , StateWS , StringList
13
12
from docutils .utils import Reporter
13
+ from typing_extensions import Never , TypeAlias
14
14
15
15
__docformat__ : Final = "reStructuredText"
16
16
@@ -35,7 +35,7 @@ class RSTStateMachine(StateMachineWS[Incomplete]):
35
35
document : nodes .document
36
36
reporter : Reporter
37
37
node : nodes .document | None
38
- def run (
38
+ def run ( # type: ignore[override]
39
39
self ,
40
40
input_lines : Sequence [str ] | StringList ,
41
41
document : nodes .document ,
@@ -51,12 +51,12 @@ class NestedStateMachine(StateMachineWS[Incomplete]):
51
51
reporter : Reporter
52
52
language : Incomplete
53
53
node : Incomplete
54
- def run (
54
+ def run ( # type: ignore[override]
55
55
self , input_lines : Sequence [str ] | StringList , input_offset : int , memo , node : nodes .Node , match_titles : bool = True
56
56
) -> list [str ]: ...
57
57
58
58
class RSTState (StateWS [list [str ]]):
59
- nested_sm : ClassVar [type [NestedStateMachine ]]
59
+ nested_sm : ClassVar [type [NestedStateMachine ]] # type: ignore[misc]
60
60
nested_sm_cache : ClassVar [list [StateMachine [Incomplete ]]]
61
61
nested_sm_kwargs : dict [str , Any ]
62
62
def __init__ (self , state_machine , debug : bool = False ) -> None : ...
@@ -270,7 +270,7 @@ class Body(RSTState):
270
270
271
271
class RFC2822Body (Body ):
272
272
patterns : ClassVar [dict [str , str | Pattern [str ]]]
273
- initial_transitions : ClassVar [list [tuple [str | tuple [str , str ], str ]]]
273
+ initial_transitions : ClassVar [list [tuple [str | tuple [str , str ], str ]]] # type: ignore[assignment]
274
274
275
275
def rfc2822 (self , match : Match [str ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [str ]]: ...
276
276
def rfc2822_field (self , match : Match [str ]): ...
@@ -295,29 +295,29 @@ class SpecializedBody(Body):
295
295
text = invalid_input
296
296
297
297
class BulletList (SpecializedBody ):
298
- def bullet (self , match : Match [str ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [Any ]]: ...
298
+ def bullet (self , match : Match [str ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [Any ]]: ... # type: ignore[override]
299
299
300
300
class DefinitionList (SpecializedBody ):
301
- def text (self , match : Match [str ], context : Any , next_state : Any ) -> tuple [list [str ], Literal ["Definition" ], list [Any ]]: ...
301
+ def text (self , match : Match [str ], context : Any , next_state : Any ) -> tuple [list [str ], Literal ["Definition" ], list [Any ]]: ... # type: ignore[override]
302
302
303
303
class EnumeratedList (SpecializedBody ):
304
304
auto : int
305
305
blank_finish : Incomplete
306
306
lastordinal : Incomplete
307
307
308
- def enumerator (self , match : Match [str ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [Any ]]: ...
308
+ def enumerator (self , match : Match [str ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [Any ]]: ... # type: ignore[override]
309
309
310
310
class FieldList (SpecializedBody ):
311
311
blank_finish : Incomplete
312
312
313
- def field_marker (
313
+ def field_marker ( # type: ignore[override]
314
314
self , match : Match [str ], context : Any , next_state : _NextState
315
315
) -> tuple [list [Any ], _NextState , list [Any ]]: ...
316
316
317
317
class OptionList (SpecializedBody ):
318
318
blank_finish : Incomplete
319
319
320
- def option_marker (
320
+ def option_marker ( # type: ignore[override]
321
321
self , match : Match [str ], context : Any , next_state : _NextState
322
322
) -> tuple [list [Any ], _NextState , list [Any ]]: ...
323
323
@@ -326,7 +326,7 @@ class RFC2822List(SpecializedBody, RFC2822Body):
326
326
initial_transitions : ClassVar [list [tuple [str | tuple [str , str ], str ]]]
327
327
blank_finish : Incomplete
328
328
329
- def rfc2822 (
329
+ def rfc2822 ( # type: ignore[override]
330
330
self , match : Match [str ], context : Any , next_state : Any
331
331
) -> tuple [list [Any ], Literal ["RFC2822List" ], list [Any ]]: ...
332
332
def blank (self , match : Any = None , context : Any = None , next_state : Any = None ) -> Never : ...
@@ -335,25 +335,23 @@ class ExtensionOptions(FieldList):
335
335
def parse_field_body (self , indented : StringList , offset : Any , node : nodes .Node ) -> None : ...
336
336
337
337
class LineBlock (SpecializedBody ):
338
- blank : Incomplete
339
338
blank_finish : Incomplete
340
339
341
340
def blank (self , match : Any = None , context : Any = None , next_state : Any = None ) -> Never : ...
342
- def line_block (self , match : Match [Any ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [Any ]]: ...
341
+ def line_block (self , match : Match [Any ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [Any ]]: ... # type: ignore[override]
343
342
344
343
class Explicit (SpecializedBody ):
345
344
blank_finish : Incomplete
346
- blank : Incomplete
347
345
348
- def explicit_markup (
346
+ def explicit_markup ( # type: ignore[override]
349
347
self , match : Match [str ], context : Any , next_state : _NextState
350
348
) -> tuple [list [Any ], _NextState , list [Any ]]: ...
351
- def anonymous (self , match : Match [str ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [Any ]]: ...
349
+ def anonymous (self , match : Match [str ], context : Any , next_state : _NextState ) -> tuple [list [Any ], _NextState , list [Any ]]: ... # type: ignore[override]
352
350
def blank (self , match : Any = None , context : Any = None , next_state : Any = None ) -> Never : ...
353
351
354
352
class SubstitutionDef (Body ):
355
353
patterns : ClassVar [dict [str , str | Pattern [str ]]]
356
- initial_transitions : ClassVar [list [str ]]
354
+ initial_transitions : ClassVar [list [str ]] # type: ignore[assignment]
357
355
blank_finish : Incomplete
358
356
359
357
def embedded_directive (self , match : Match [str ], context : Any , next_state : Any ) -> Never : ...
@@ -387,18 +385,18 @@ class SpecializedText(Text):
387
385
388
386
class Definition (SpecializedText ):
389
387
def eof (self , context : Any ) -> list [Any ]: ...
390
- def indent (
391
- self , match : Any , context : StringList , next_state : Any
388
+ def indent ( # type: ignore[override]
389
+ self , match : Any , context : list [ str ] , next_state : Any
392
390
) -> tuple [list [Any ], Literal ["DefinitionList" ], list [Any ]]: ...
393
391
394
392
class Line (SpecializedText ):
395
393
eofcheck : Literal [1 ]
396
394
397
395
def eof (self , context : Any ) -> list [Any ]: ...
398
- def blank (self , match : Any , context : Any , next_state : Any ) -> tuple [list [Any ], Literal ["Body" ], list [Any ]]: ...
399
- def text (self , match : Match [str ], context : StringList , next_state : Any ) -> tuple [list [Any ], Literal ["Body" ], list [Any ]]: ...
400
- def indent (self , match : Match [str ], context : StringList , next_state : Any ) -> tuple [list [Any ], Literal ["Body" ], list [Any ]]: ...
401
- def underline (self , match : Any , context : StringList , next_state : Any ) -> tuple [list [Any ], Literal ["Body" ], list [Any ]]: ...
396
+ def blank (self , match : Any , context : Any , next_state : Any ) -> tuple [list [Any ], Literal ["Body" ], list [Any ]]: ... # type: ignore[override]
397
+ def text (self , match : Match [str ], context : list [ str ] , next_state : Any ) -> tuple [list [Any ], Literal ["Body" ], list [Any ]]: ... # type: ignore[override]
398
+ def indent (self , match : Match [str ], context : list [ str ] , next_state : Any ) -> tuple [list [Any ], Literal ["Body" ], list [Any ]]: ... # type: ignore[override]
399
+ def underline (self , match : Any , context : list [ str ] , next_state : Any ) -> tuple [list [Any ], Literal ["Body" ], list [Any ]]: ... # type: ignore[override]
402
400
def short_overline (self , context : list [Any ], blocktext : Any , lineno : int | None , lines : int = 1 ) -> None : ...
403
401
def state_correction (self , context : list [Any ], lines : int = 1 ) -> Never : ...
404
402
@@ -414,8 +412,8 @@ class QuotedLiteralBlock(RSTState):
414
412
) -> tuple [_EmptyContext , _NextState , list [Any ]]: ...
415
413
@overload
416
414
def blank (self , match : Any , context : Any , next_state : _NextState ) -> Never : ...
417
- def eof (self , context : StringList ) -> list [Any ]: ...
418
- def indent (self , match : Any , context : StringList , next_state : Any ) -> Never : ...
415
+ def eof (self , context : list [ str ] ) -> list [Any ]: ...
416
+ def indent (self , match : Any , context : list [ str ] , next_state : Any ) -> Never : ...
419
417
def initial_quoted (
420
418
self , match : Match [str ], context : Any , next_state : _NextState
421
419
) -> tuple [list [str ], _NextState , list [Any ]]: ...
0 commit comments