mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 21:12:25 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
from typing import Any, Callable
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
import docutils.nodes
|
||||
import docutils.parsers.rst.states
|
||||
from docutils.languages import _LanguageModule
|
||||
from docutils.utils import Reporter, SystemMessage
|
||||
|
||||
_RoleFn = Callable[
|
||||
_RoleFn: TypeAlias = Callable[
|
||||
[str, str, str, int, docutils.parsers.rst.states.Inliner, dict[str, Any], list[str]],
|
||||
tuple[list[docutils.nodes.reference], list[docutils.nodes.reference]],
|
||||
]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import optparse
|
||||
from collections.abc import Iterable
|
||||
from typing import Any
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
from docutils import ApplicationError
|
||||
from docutils.io import FileOutput
|
||||
@@ -17,7 +17,7 @@ class DependencyList:
|
||||
def add(self, *filenames: str) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
_SystemMessageLevel = Literal[0, 1, 2, 3, 4]
|
||||
_SystemMessageLevel: TypeAlias = Literal[0, 1, 2, 3, 4]
|
||||
|
||||
class Reporter:
|
||||
DEBUG_LEVEL: Literal[0]
|
||||
|
||||
Reference in New Issue
Block a user