GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-100117: Make `co_lines` more efficient by brandtbucher · Pull Request #100447 · python/cpython

Conversation

@brandtbucher

@brandtbucher brandtbucher commented Dec 23, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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
  • Issue: code.co_positions behaviour does not match documentation #100117

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vasily-v-ryabov reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
brandtbucher added 3 commits December 17, 2022 19:47
@brandtbucher
Update existing co_lines tests
fe91dae
@brandtbucher
Merge overlapping line ranges in co_lines
f19e001
@brandtbucher
blurb add
071bcb9
@brandtbucher brandtbucher added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Dec 23, 2022
@brandtbucher brandtbucher self-assigned this Dec 23, 2022
@brandtbucher
brandtbucher requested a review from markshannon as a code owner December 23, 2022 01:29
@bedevere-bot bedevere-bot mentioned this pull request Dec 23, 2022
code.co_positions behaviour does not match documentation #100117
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Dec 23, 2022
@markshannon
markshannon merged commit f07daaf into python:main Jan 10, 2023
@bedevere-bot bedevere-bot removed the awaiting core review label Jan 10, 2023
@markshannon

markshannon commented Jan 10, 2023

Copy link
Copy Markdown
Member

Thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@brandtbucher brandtbucher

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs)

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@brandtbucher @markshannon @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.