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-111744: Make `breakpoint()` enter the debugger immediately by gaogaotiantian · Pull Request #118579 · python/cpython

Conversation

@gaogaotiantian

@gaogaotiantian gaogaotiantian commented May 4, 2024 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

We had some discussion in #111744 and in discord channel. We know this is a breaking change but people agree it's much more intuitive.

This basically changes the breakpoint() and pdb.set_trace() behavior so it stops immediately after the call, rather than before the next line.

Unfortunately a lot of the test cases need to be adapted.

  • Issue: breakpoint does not enter pdb until the "next event" happens #111744

📚 Documentation preview 📚: https://cpython-previews--118579.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

oneroyalace reacted with hooray emoji
All reactions
  • 🎉 1 reaction
gaogaotiantian added 2 commits May 4, 2024 11:25
@gaogaotiantian
Make breakpoint break immediately
2a35fbc
@gaogaotiantian
Update docs
c848968
@bedevere-app bedevere-app Bot added the awaiting review label May 4, 2024
@gaogaotiantian
gaogaotiantian requested a review from brandtbucher May 4, 2024 18:38
@bedevere-app bedevere-app Bot mentioned this pull request May 4, 2024
breakpoint does not enter pdb until the "next event" happens #111744
Closed
gaogaotiantian and others added 2 commits May 4, 2024 11:39
@gaogaotiantian
Add a news entry for it
63a0915
@blurb-it
📜🤖 Added by blurb_it.
7adfcea
@brandtbucher

brandtbucher commented May 4, 2024

Copy link
Copy Markdown
Member

this is a breaking change

Haha.

Away from my computer now, but I’ll take a look at this today.

All reactions

Sorry, something went wrong.

Uh oh!

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

@brandtbucher brandtbucher self-assigned this May 4, 2024
@gaogaotiantian

gaogaotiantian commented May 4, 2024

Copy link
Copy Markdown
Member Author

this is a breaking change

Haha.

Pun is actually not intended. Took me a second to realize what's funny :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@gaogaotiantian
Fix doctest
a1fc073
@ambv

ambv commented May 4, 2024

Copy link
Copy Markdown
Contributor

This is a breaking change but I can't tell you how many times I wanted to look at the state of a function, I put breakpoint() at the last line... and it stopped after leaving the function altogether 😵‍💫

So this is great to see!

All reactions

Sorry, something went wrong.

Uh oh!

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

brandtbucher
brandtbucher reviewed May 4, 2024
View reviewed changes
Comment thread Lib/bdb.py Resolved

Uh oh!

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

brandtbucher
brandtbucher reviewed May 4, 2024
View reviewed changes
Comment thread Doc/library/pdb.rst Resolved

Uh oh!

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

@brandtbucher

brandtbucher commented May 4, 2024

Copy link
Copy Markdown
Member

Test changes look good. Thanks for applying a variety of fixes there.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gaogaotiantian
Update docs
514b881
brandtbucher
brandtbucher approved these changes May 4, 2024
View reviewed changes

@brandtbucher brandtbucher left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I'll leave it open for a bit in case others have thoughts.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels May 4, 2024
@brandtbucher
brandtbucher merged commit 5a0022a into python:main May 5, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label May 5, 2024
@gaogaotiantian
gaogaotiantian deleted the pdb-breakpoint branch May 5, 2024 17:15
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
@gaogaotiantian @SonicField
pythonGH-111744: Make breakpoint() enter the debugger immediately (py…
75c1dc2
…thonGH-118579)
@Viicos Viicos mentioned this pull request Nov 27, 2024
Setting f_trace_opcodes to True can lead to f_lineno being removed in some cases (using breakpoint()/pdb.set_trace()) #127321
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@brandtbucher brandtbucher brandtbucher approved these changes

Uh oh!

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

Assignees

@brandtbucher brandtbucher

Labels

None yet

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

@gaogaotiantian @brandtbucher @ambv
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.