Skip to content

Commit

Permalink
stdlib: Use Literal in difflib.SequenceMatcher.get_opcodes (python#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Sunglasses authored Feb 23, 2024
1 parent 3c08a97 commit 49b1a1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/difflib.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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: ...
Expand Down

0 comments on commit 49b1a1a

Please sign in to comment.