Skip to content

Commit 6e474f2

Browse files
authored
[difflib] Update pat param for IS_LINE_JUNK (#14449)
1 parent 4a8635d commit 6e474f2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

stdlib/difflib.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import re
2+
import sys
13
from collections.abc import Callable, Iterable, Iterator, Sequence
24
from types import GenericAlias
35
from typing import Any, AnyStr, Generic, Literal, NamedTuple, TypeVar, overload
@@ -60,7 +62,12 @@ class Differ:
6062
def __init__(self, linejunk: Callable[[str], bool] | None = None, charjunk: Callable[[str], bool] | None = None) -> None: ...
6163
def compare(self, a: Sequence[str], b: Sequence[str]) -> Iterator[str]: ...
6264

63-
def IS_LINE_JUNK(line: str, pat: Any = ...) -> bool: ... # pat is undocumented
65+
if sys.version_info >= (3, 14):
66+
def IS_LINE_JUNK(line: str, pat: Callable[[str], re.Match[str] | None] | None = None) -> bool: ...
67+
68+
else:
69+
def IS_LINE_JUNK(line: str, pat: Callable[[str], re.Match[str] | None] = ...) -> bool: ...
70+
6471
def IS_CHARACTER_JUNK(ch: str, ws: str = " \t") -> bool: ... # ws is undocumented
6572
def unified_diff(
6673
a: Sequence[str],

0 commit comments

Comments
 (0)