Skip to content

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Dec 23, 2022

Basically, this just merges all of the entries for a given line range into a single tuple. This can have a dramatic effect on the size of the resulting iterator:

Before:

>>> from dis import dis as example
>>> lines = list(example.__code__.co_lines())
>>> len(lines)
148

After:

>>> from dis import dis as example
>>> lines = list(example.__code__.co_lines())
>>> len(lines)
39

@markshannon
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants