diff --git a/stdlib/2/difflib.pyi b/stdlib/2and3/difflib.pyi similarity index 95% rename from stdlib/2/difflib.pyi rename to stdlib/2and3/difflib.pyi index e0809f867..cae69775c 100644 --- a/stdlib/2/difflib.pyi +++ b/stdlib/2and3/difflib.pyi @@ -1,8 +1,6 @@ -# Stubs for difflib +# Based on https://docs.python.org/2.7/library/difflib.html and https://docs.python.org/3.2/library/difflib.html -# Based on https://docs.python.org/2.7/library/difflib.html - -# TODO: Support unicode? +# TODO: Support unicode in Python 2? from typing import ( TypeVar, Callable, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, diff --git a/stdlib/3/difflib.pyi b/stdlib/3/difflib.pyi deleted file mode 100644 index f2fb7a879..000000000 --- a/stdlib/3/difflib.pyi +++ /dev/null @@ -1,62 +0,0 @@ -# Stubs for difflib - -# Based on https://docs.python.org/3.2/library/difflib.html - -from typing import ( - TypeVar, Callable, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, - Generic, Optional -) - -_T = TypeVar('_T') - -class SequenceMatcher(Generic[_T]): - def __init__(self, isjunk: Optional[Callable[[_T], bool]] = ..., - a: Sequence[_T] = ..., b: Sequence[_T] = ..., - autojunk: bool = ...) -> None: ... - 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) -> Tuple[int, int, int]: ... - def get_matching_blocks(self) -> List[Tuple[int, int, int]]: ... - def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ... - def get_grouped_opcodes(self, n: int = ... - ) -> Iterable[Tuple[str, int, int, int, int]]: ... - def ratio(self) -> float: ... - def quick_ratio(self) -> float: ... - def real_quick_ratio(self) -> float: ... - -def get_close_matches(word: Sequence[_T], possibilities: List[Sequence[_T]], - n: int = ..., cutoff: float = ...) -> List[Sequence[_T]]: ... - -class Differ: - def __init__(self, linejunk: Callable[[str], bool] = ..., - charjunk: Callable[[str], bool] = ...) -> None: ... - def compare(self, a: Sequence[str], b: Sequence[str]) -> Iterator[str]: ... - -def IS_LINE_JUNK(str) -> bool: ... -def IS_CHARACTER_JUNK(str) -> bool: ... -def unified_diff(a: Sequence[str], b: Sequence[str], fromfile: str = ..., - tofile: str = ..., fromfiledate: str = ..., tofiledate: str = ..., - n: int = ..., lineterm: str = ...) -> Iterator[str]: ... -def context_diff(a: Sequence[str], b: Sequence[str], fromfile: str=..., - tofile: str = ..., fromfiledate: str = ..., tofiledate: str = ..., - n: int = ..., lineterm: str = ...) -> Iterator[str]: ... -def ndiff(a: Sequence[str], b: Sequence[str], - linejunk: Callable[[str], bool] = ..., - charjunk: Callable[[str], bool] = ... - ) -> Iterator[str]: ... - -class HtmlDiff: - def __init__(self, tabsize: int = ..., wrapcolumn: int = ..., - linejunk: Callable[[str], bool] = ..., - charjunk: Callable[[str], bool] = ... - ) -> None: ... - def make_file(self, fromlines: Sequence[str], tolines: Sequence[str], - fromdesc: str = ..., todesc: str = ..., context: bool = ..., - numlines: int = ...) -> str: ... - def make_table(self, fromlines: Sequence[str], tolines: Sequence[str], - fromdesc: str = ..., todesc: str = ..., context: bool = ..., - numlines: int = ...) -> str: ... - -def restore(delta: Iterable[str], which: int) -> Iterator[int]: ...