mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-02 17:43:25 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from collections.abc import Iterable, Iterator, Sequence
|
||||
from typing import Any, Tuple
|
||||
from typing import Any
|
||||
|
||||
from pygments.token import _TokenType
|
||||
from pygments.util import Future
|
||||
@@ -40,7 +40,7 @@ class _inherit: ...
|
||||
|
||||
inherit: Any
|
||||
|
||||
class combined(Tuple[Any]):
|
||||
class combined(tuple[Any]):
|
||||
def __new__(cls, *args): ...
|
||||
def __init__(self, *args) -> None: ...
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
from _typeshed import StrOrBytesPath, StrPath
|
||||
from collections.abc import Iterator
|
||||
from typing import Any, Tuple, Union
|
||||
from typing import Any, Union
|
||||
|
||||
from pygments.lexer import Lexer, LexerMeta
|
||||
|
||||
_OpenFile = Union[StrOrBytesPath, int] # copy/pasted from builtins.pyi
|
||||
|
||||
# TODO: use lower-case tuple once mypy updated
|
||||
def get_all_lexers() -> Iterator[tuple[str, Tuple[str, ...], Tuple[str, ...], Tuple[str, ...]]]: ...
|
||||
def get_all_lexers() -> Iterator[tuple[str, tuple[str, ...], tuple[str, ...], tuple[str, ...]]]: ...
|
||||
def find_lexer_class(name: str) -> LexerMeta | None: ...
|
||||
def find_lexer_class_by_name(_alias: str) -> LexerMeta: ...
|
||||
def get_lexer_by_name(_alias: str, **options: Any) -> Lexer: ...
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from collections.abc import Mapping
|
||||
from typing import Tuple
|
||||
|
||||
class _TokenType(Tuple[str]): # TODO: change to lower-case tuple once new mypy released
|
||||
class _TokenType(tuple[str]): # TODO: change to lower-case tuple once new mypy released
|
||||
parent: _TokenType | None
|
||||
def split(self) -> list[_TokenType]: ...
|
||||
subtypes: set[_TokenType]
|
||||
|
||||
Reference in New Issue
Block a user