From 8e03f33d84bc0a86da272634ee3c7b03b9a6debe Mon Sep 17 00:00:00 2001 From: Shantanu Date: Sun, 24 May 2020 17:41:45 -0700 Subject: [PATCH] difflib: update for py39 (#4067) Adds default values, the hi params can now be None Co-authored-by: hauntsaninja <> --- stdlib/2and3/difflib.pyi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/difflib.pyi b/stdlib/2and3/difflib.pyi index 4804ef820..110abf7a3 100644 --- a/stdlib/2and3/difflib.pyi +++ b/stdlib/2and3/difflib.pyi @@ -28,8 +28,10 @@ class SequenceMatcher(Generic[_T]): def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... 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: ... + if sys.version_info >= (3, 9): + def find_longest_match(self, alo: int = ..., ahi: Optional[int] = ..., blo: int = ..., bhi: Optional[int] = ...) -> Match: ... + else: + 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 = ...