Method: difflib.Differ._qformat
Calls: 73, Exceptions: 0, Paths: 3Back
Path 1: 49 calls (0.67)
' 1. Beautiful is beTTer than ugly.' (18) 'line 4 changed' (3) 'line 5 changed' (3) 'line 6 changed' (3) 'just fits in!!' (3) 'just fits in tw...
' 1. Beautiful is better than ugly.' (17) 'line 4 chanGEd' (3) 'line 5a chanGed' (3) 'line 6a changEd' (3) 'just fitS in!!' (3) 'just fits in tw...
' ^^ ' (17) ' ^^ ' (3) ' ^ ^ ' (3) ' ^ ^ ' (3) ' ^ ' (3) ' ...
' ^^ ' (17) ' ^^ ' (3) ' ^ ^ ' (3) ' ^ ^ ' (3) ' ^ ' (3) ' ...
None (49) '? ^^\n' (34) '- 1. Beautiful is beTTer than ugly.' (18) '+ 1. Beautiful is better than ugly.' (17) '? ...
1def _qformat(self, aline, bline, atags, btags):
2 r"""
3 Format "?" output and deal with tabs.
4
5 Example:
6
7 >>> d = Differ()
8 >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
9 ... ' ^ ^ ^ ', ' ^ ^ ^ ')
10 >>> for line in results: print(repr(line))
11 ...
12 '- \tabcDefghiJkl\n'
13 '? \t ^ ^ ^\n'
14 '+ \tabcdefGhijkl\n'
15 '? \t ^ ^ ^\n'
16 """
17 atags = _keep_original_ws(aline, atags).rstrip()
18 btags = _keep_original_ws(bline, btags).rstrip()
19
20 yield "- " + aline
21 if atags:
22 yield f"? {atags}\n"
23
24 yield "+ " + bline
25 if btags:
26 yield f"? {btags}\n"
Path 2: 19 calls (0.26)
' 3. Simple is better than complex.' (17) '\t \t \t^' (1) ' 3. Simple is better than complex.\n' (1)
' 3. Simple is better than complex.' (17) '\t \t \t^\n' (1) ' 3. Simple is better than complex.\n' (1)
' ' (18) ' ' (1)
' ++ ' (17) ' +' (1) ' ++ ' (1)
None (19) '- 3. Simple is better than complex.' (17) '+ 3. Simple is better than complex.' (17) '? ++\n' (17) '- \t \t \t^' (1) '+ \t \t ...
1def _qformat(self, aline, bline, atags, btags):
2 r"""
3 Format "?" output and deal with tabs.
4
5 Example:
6
7 >>> d = Differ()
8 >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
9 ... ' ^ ^ ^ ', ' ^ ^ ^ ')
10 >>> for line in results: print(repr(line))
11 ...
12 '- \tabcDefghiJkl\n'
13 '? \t ^ ^ ^\n'
14 '+ \tabcdefGhijkl\n'
15 '? \t ^ ^ ^\n'
16 """
17 atags = _keep_original_ws(aline, atags).rstrip()
18 btags = _keep_original_ws(bline, btags).rstrip()
19
20 yield "- " + aline
21 if atags:
22 yield f"? {atags}\n"
23
24 yield "+ " + bline
25 if btags:
26 yield f"? {btags}\n"
Path 3: 5 calls (0.07)
'three\n' (3) 'Line 5: has from:[t] to:[ss] at end\t' (1) 'Line 5: has from:[t] to:[ss] at end\t\t\t\t\t' (1)
'tree\n' (3) 'Line 5: has from:[t] to:[ss] at end' (2)
' - ' (3) ' -' (1) ' -----' (1)
' ' (3) ' ' (2)
'- three\n' (3) '? -\n' (3) '+ tree\n' (3) '+ Line 5: has from:[t] to:[ss] at end' (2) '- Line 5: has from:[t] to:[ss] at end\t' (1) '? ...
1def _qformat(self, aline, bline, atags, btags):
2 r"""
3 Format "?" output and deal with tabs.
4
5 Example:
6
7 >>> d = Differ()
8 >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
9 ... ' ^ ^ ^ ', ' ^ ^ ^ ')
10 >>> for line in results: print(repr(line))
11 ...
12 '- \tabcDefghiJkl\n'
13 '? \t ^ ^ ^\n'
14 '+ \tabcdefGhijkl\n'
15 '? \t ^ ^ ^\n'
16 """
17 atags = _keep_original_ws(aline, atags).rstrip()
18 btags = _keep_original_ws(bline, btags).rstrip()
19
20 yield "- " + aline
21 if atags:
22 yield f"? {atags}\n"
23
24 yield "+ " + bline
25 if btags:
26 yield f"? {btags}\n"