-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdifflib_rs.pyi
More file actions
64 lines (56 loc) · 1.7 KB
/
difflib_rs.pyi
File metadata and controls
64 lines (56 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""Type stubs for difflib_rs - Rust implementation of Python's difflib.unified_diff"""
from typing import List, Optional
def unified_diff(
a: List[str],
b: List[str],
fromfile: str = "",
tofile: str = "",
fromfiledate: str = "",
tofiledate: str = "",
n: int = 3,
lineterm: str = "\n"
) -> List[str]:
"""
Compare two sequences of lines; generate the unified diff.
Args:
a: First sequence of lines
b: Second sequence of lines
fromfile: Name of the first file
tofile: Name of the second file
fromfiledate: Timestamp for the first file
tofiledate: Timestamp for the second file
n: Number of context lines
lineterm: Line terminator string
Returns:
Generator-like list of diff lines
"""
...
def unified_diff_str(
a: str,
b: str,
fromfile: str = "",
tofile: str = "",
fromfiledate: str = "",
tofiledate: str = "",
n: int = 3,
lineterm: str = "\n",
keepends: bool = False
) -> List[str]:
"""
Compare two strings; generate the unified diff.
This is a convenience function that handles string splitting internally,
providing better performance than splitting in Python.
Args:
a: First string to compare
b: Second string to compare
fromfile: Name of the first file
tofile: Name of the second file
fromfiledate: Timestamp for the first file
tofiledate: Timestamp for the second file
n: Number of context lines
lineterm: Line terminator string
keepends: Whether to keep line endings when splitting
Returns:
Generator-like list of diff lines
"""
...