mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-24 09:48:39 +08:00
[docutils] Extend applicable types to _ContentModelCategory (#14719)
This commit is contained in:
@@ -36,9 +36,3 @@ docutils.readers.TYPE_CHECKING
|
||||
docutils.utils.TYPE_CHECKING
|
||||
docutils.writers.TYPE_CHECKING
|
||||
docutils.writers._html_base.TYPE_CHECKING
|
||||
|
||||
# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
|
||||
# See https://github.com/python/typeshed/pull/14699
|
||||
docutils\.nodes\.\w+\.content_model
|
||||
docutils.parsers.docutils_xml.Unknown.content_model
|
||||
docutils.transforms.universal.SmartQuotes.nodes_to_skip
|
||||
|
||||
@@ -12,7 +12,8 @@ from docutils.transforms import Transform, Transformer
|
||||
from docutils.utils import Reporter
|
||||
|
||||
_N = TypeVar("_N", bound=Node)
|
||||
_ContentModelCategory: TypeAlias = type[Element] | tuple[type[Element], ...]
|
||||
_ElementLikeType: TypeAlias = type[Element | Text | Body | Bibliographic | Inline]
|
||||
_ContentModelCategory: TypeAlias = _ElementLikeType | tuple[_ElementLikeType, ...]
|
||||
_ContentModelQuantifier: TypeAlias = Literal[".", "?", "+", "*"]
|
||||
_ContentModelItem: TypeAlias = tuple[_ContentModelCategory, _ContentModelQuantifier]
|
||||
_ContentModelTuple: TypeAlias = tuple[_ContentModelItem, ...]
|
||||
|
||||
@@ -43,7 +43,7 @@ class StripClassesAndElements(Transform):
|
||||
|
||||
class SmartQuotes(Transform):
|
||||
default_priority: ClassVar[int]
|
||||
nodes_to_skip: ClassVar[tuple[type[nodes.Node], ...]]
|
||||
nodes_to_skip: ClassVar[tuple[type[nodes.Node | nodes.Special], ...]]
|
||||
literal_nodes: ClassVar[tuple[type[nodes.Node | nodes.Body], ...]]
|
||||
smartquotes_action: ClassVar[str]
|
||||
unsupported_languages: set[str]
|
||||
|
||||
Reference in New Issue
Block a user