mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
stdlib: Use Literal in difflib.SequenceMatcher.get_opcodes (#11464)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from collections.abc import Callable, Iterable, Iterator, Sequence
|
||||
from typing import Any, AnyStr, Generic, NamedTuple, TypeVar, overload
|
||||
from typing import Any, AnyStr, Generic, Literal, NamedTuple, TypeVar, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -49,7 +49,7 @@ class SequenceMatcher(Generic[_T]):
|
||||
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_opcodes(self) -> list[tuple[Literal["replace", "delete", "insert", "equal"], int, int, int, int]]: ...
|
||||
def get_grouped_opcodes(self, n: int = 3) -> Iterable[list[tuple[str, int, int, int, int]]]: ...
|
||||
def ratio(self) -> float: ...
|
||||
def quick_ratio(self) -> float: ...
|
||||
|
||||
Reference in New Issue
Block a user