mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-08 20:43:25 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, ClassVar, NamedTuple, Tuple
|
||||
from typing import Any, ClassVar, NamedTuple
|
||||
|
||||
__docformat__: str
|
||||
__version__: str
|
||||
@@ -23,19 +23,19 @@ class ApplicationError(Exception): ...
|
||||
class DataError(ApplicationError): ...
|
||||
|
||||
class SettingsSpec:
|
||||
settings_spec: ClassVar[Tuple[Any, ...]]
|
||||
settings_spec: ClassVar[tuple[Any, ...]]
|
||||
settings_defaults: ClassVar[dict[Any, Any] | None]
|
||||
settings_default_overrides: ClassVar[dict[Any, Any] | None]
|
||||
relative_path_settings: ClassVar[Tuple[Any, ...]]
|
||||
relative_path_settings: ClassVar[tuple[Any, ...]]
|
||||
config_section: ClassVar[str | None]
|
||||
config_section_dependencies: ClassVar[Tuple[str, ...] | None]
|
||||
config_section_dependencies: ClassVar[tuple[str, ...] | None]
|
||||
|
||||
class TransformSpec:
|
||||
def get_transforms(self) -> list[Any]: ...
|
||||
default_transforms: ClassVar[Tuple[Any, ...]]
|
||||
default_transforms: ClassVar[tuple[Any, ...]]
|
||||
unknown_reference_resolvers: ClassVar[list[Any]]
|
||||
|
||||
class Component(SettingsSpec, TransformSpec):
|
||||
component_type: ClassVar[str | None]
|
||||
supported: ClassVar[Tuple[str, ...]]
|
||||
supported: ClassVar[tuple[str, ...]]
|
||||
def supports(self, format: str) -> bool: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import optparse
|
||||
from collections.abc import Iterable, Mapping
|
||||
from configparser import RawConfigParser
|
||||
from typing import Any, ClassVar, Tuple, Type
|
||||
from typing import Any, ClassVar, Type
|
||||
|
||||
from docutils import SettingsSpec
|
||||
from docutils.parsers import Parser
|
||||
@@ -45,7 +45,7 @@ def validate_smartquotes_locales(
|
||||
) -> list[tuple[str, str]]: ...
|
||||
def make_paths_absolute(pathdict, keys, base_path: Any | None = ...) -> None: ...
|
||||
def make_one_path_absolute(base_path, path) -> str: ...
|
||||
def filter_settings_spec(settings_spec, *exclude, **replace) -> Tuple[Any, ...]: ...
|
||||
def filter_settings_spec(settings_spec, *exclude, **replace) -> tuple[Any, ...]: ...
|
||||
|
||||
class Values(optparse.Values):
|
||||
def update(self, other_dict, option_parser) -> None: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import ClassVar, Tuple
|
||||
from typing import ClassVar
|
||||
|
||||
from docutils import parsers
|
||||
|
||||
class Parser(parsers.Parser):
|
||||
config_section_dependencies: ClassVar[Tuple[str, ...]]
|
||||
config_section_dependencies: ClassVar[tuple[str, ...]]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from typing import Any, ClassVar, Tuple
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from docutils import parsers
|
||||
from docutils.parsers.rst import states
|
||||
|
||||
class Parser(parsers.Parser):
|
||||
config_section_dependencies: ClassVar[Tuple[str, ...]]
|
||||
config_section_dependencies: ClassVar[tuple[str, ...]]
|
||||
initial_state: Literal["Body", "RFC2822Body"]
|
||||
state_classes: Any
|
||||
inliner: Any
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from typing import Any, Callable, Dict, List, Tuple
|
||||
from typing import Any, Callable
|
||||
|
||||
import docutils.nodes
|
||||
import docutils.parsers.rst.states
|
||||
|
||||
_RoleFn = Callable[
|
||||
[str, str, str, int, docutils.parsers.rst.states.Inliner, Dict[str, Any], List[str]],
|
||||
Tuple[List[docutils.nodes.reference], List[docutils.nodes.reference]],
|
||||
[str, str, str, int, docutils.parsers.rst.states.Inliner, dict[str, Any], list[str]],
|
||||
tuple[list[docutils.nodes.reference], list[docutils.nodes.reference]],
|
||||
]
|
||||
|
||||
def register_local_role(name: str, role_fn: _RoleFn) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user