Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-103082: Turn on branch events for FOR_ITER instructions.#103507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

markshannon
Copy link
Member

@markshannonmarkshannon commentedApr 13, 2023
edited by bedevere-bot
Loading

Turn onBRANCH events forFOR_ITER instruction, and add test.

Skipping news as this will be covered by the main news/what's new and documentation for PEP 669.

('jump', 'func', 6, 2),
('branch', 'func', 2, 2),
('branch', 'func', 3, 4),
('jump', 'func', 4, 2),
Copy link
Member

Choose a reason for hiding this comment

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

is this the jump over the else?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

No, this is the jump back to the start of the loop.

('line', 'func', 4),
('jump', 'func', 4, 2),
('branch', 'func', 2, 2),
('line', 'func', 2),
Copy link
Member

Choose a reason for hiding this comment

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

isn't the line event suppose to come before the branch on that line?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The line event becomes before any other events for that instruction, but the jumps and branches are for other instructions.

The jump 4 -> 2 is the jump back to theFOR_ITER. TheFOR_ITER instruction isn't the first instruction on line 2. The branch 2 -> 2 is the exit from theFOR_ITER.
The final "line 2" event is from the implicitreturn None which has line number 2.
It is marked as a line event because the previous instruction has a different line number.

TBH, line events aren't that useful for this sort of tracing, their use case is for debuggers.

@markshannonmarkshannon merged commit70e0a28 intopython:mainApr 13, 2023
@markshannonmarkshannon deleted the branch-events-for-iter branchApril 13, 2023 12:56
carljm added a commit to carljm/cpython that referenced this pull requestApr 13, 2023
* main:pythongh-103479: [Enum] require __new__ to be considered a data type (pythonGH-103495)pythongh-103365: [Enum] STRICT boundary corrections (pythonGH-103494)pythonGH-103488: Use return-offset, not yield-offset. (pythonGH-103502)pythongh-103088: Fix test_venv error message to avoid bytes/str warning (pythonGH-103500)pythonGH-103082: Turn on branch events for FOR_ITER instructions. (python#103507)pythongh-102978: Fix mock.patch function signatures for class and staticmethod decorators (python#103228)pythongh-103462: Ensure SelectorSocketTransport.writelines registers a writer when data is still pending (python#103463)pythongh-95299: Rework test_cppext.py to not invoke setup.py directly (python#103316)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@iritkatrieliritkatrieliritkatriel approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@markshannon@iritkatriel@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp