mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,19 +1,4 @@
|
||||
from typing import (
|
||||
Any,
|
||||
AnyStr,
|
||||
Callable,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
List,
|
||||
NamedTuple,
|
||||
Sequence,
|
||||
Text,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, NamedTuple, Sequence, Text, TypeVar, Union, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -35,9 +20,9 @@ class SequenceMatcher(Generic[_T]):
|
||||
def set_seq1(self, a: Sequence[_T]) -> None: ...
|
||||
def set_seq2(self, b: Sequence[_T]) -> None: ...
|
||||
def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ...
|
||||
def get_matching_blocks(self) -> List[Match]: ...
|
||||
def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ...
|
||||
def get_grouped_opcodes(self, n: int = ...) -> Iterable[List[Tuple[str, int, int, int, int]]]: ...
|
||||
def get_matching_blocks(self) -> list[Match]: ...
|
||||
def get_opcodes(self) -> list[tuple[str, int, int, int, int]]: ...
|
||||
def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[tuple[str, int, int, int, int]]]: ...
|
||||
def ratio(self) -> float: ...
|
||||
def quick_ratio(self) -> float: ...
|
||||
def real_quick_ratio(self) -> float: ...
|
||||
@@ -46,11 +31,11 @@ class SequenceMatcher(Generic[_T]):
|
||||
@overload
|
||||
def get_close_matches( # type: ignore
|
||||
word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ...
|
||||
) -> List[AnyStr]: ...
|
||||
) -> list[AnyStr]: ...
|
||||
@overload
|
||||
def get_close_matches(
|
||||
word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ...
|
||||
) -> List[Sequence[_T]]: ...
|
||||
) -> list[Sequence[_T]]: ...
|
||||
|
||||
class Differ:
|
||||
def __init__(self, linejunk: _JunkCallback | None = ..., charjunk: _JunkCallback | None = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user