improve type annotations in 'docutils.parsers.rst.directives.misc' (#11524)

Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
danieleades
2024-03-13 13:44:58 +00:00
committed by GitHub
parent 7894b095eb
commit 15536bd391
2 changed files with 35 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ docutils.nodes.GenericNodeVisitor.__getattr__
# these methods take a rawsource parameter that has been deprecated and is completely ignored, so we omit it from the stub
docutils.nodes.Text.__new__
docutils.parsers.recommonmark_wrapper
docutils.parsers.rst.directives.misc.MetaBody.__getattr__
docutils.transforms.Transform.__getattr__
docutils.transforms.Transformer.__getattr__
docutils.TransformSpec.unknown_reference_resolvers

View File

@@ -1,3 +1,36 @@
from _typeshed import Incomplete
from pathlib import Path
from re import Pattern
from typing import ClassVar
def __getattr__(name: str) -> Incomplete: ...
from docutils.parsers.rst import Directive
from docutils.parsers.rst.states import SpecializedBody
__docformat__: str
class Include(Directive):
standard_include_path: Path
class Raw(Directive): ...
class Replace(Directive): ...
class Unicode(Directive):
comment_pattern: Pattern[str]
class Class(Directive): ...
class Role(Directive):
argument_pattern: Pattern[str]
class DefaultRole(Directive): ...
class Title(Directive): ...
# SpecializedBody has not yet been stubbed
class MetaBody(SpecializedBody): # pyright: ignore[reportUntypedBaseClass]
def __getattr__(self, name: str) -> Incomplete: ...
class Meta(Directive):
SMkwargs: ClassVar[dict[str, tuple[MetaBody]]]
class Date(Directive): ...
class TestDirective(Directive): ...