mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-100117: Make co_lines
more efficient (GH-100447)
This commit is contained in:
parent
b2f7b2ef0b
commit
f07daaf4f7
4 changed files with 26 additions and 38 deletions
|
@ -702,7 +702,8 @@ class CodeLocationTest(unittest.TestCase):
|
|||
|
||||
def check_lines(self, func):
|
||||
co = func.__code__
|
||||
lines1 = list(dedup(l for (_, _, l) in co.co_lines()))
|
||||
lines1 = [line for _, _, line in co.co_lines()]
|
||||
self.assertEqual(lines1, list(dedup(lines1)))
|
||||
lines2 = list(lines_from_postions(positions_from_location_table(co)))
|
||||
for l1, l2 in zip(lines1, lines2):
|
||||
self.assertEqual(l1, l2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue