Skip to content

Conversation

@picnixz
Copy link
Member

@picnixzpicnixz commented Aug 22, 2024

Mark suggested simplifying the faking of positions information via ast manipulation so here it is.

cc @iritkatriel@markshannon

@iritkatriel
Copy link
Member

Note: if someone knows a way to include partial positions information as well as no position information (but only for a single instruction, and not for the entire code object otherwise we cannot test the -- rendering) by changing AST nodes only, please tell me.

The same way that dis tests '--' for line numbers should work. It inputs python code that gets compiled into something that needs '--'.

@picnixz
Copy link
MemberAuthor

It inputs python code that gets compiled into something that needs '--'.

Mmh, yes it was dumb of me. I'll try this approach now.

@picnixz
Copy link
MemberAuthor

picnixz commented Aug 22, 2024

The tests are a bit longer (in length) but at least I don't need some magical construction that I would forget about tomorrow :D Thank you all for the tips.

Copy link
Member

@iritkatrieliritkatriel left a comment

Choose a reason for hiding this comment

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

LGTM

@iritkatrieliritkatriel merged commit 31acc4d into python:mainAug 22, 2024
@picnixzpicnixz deleted the simplify-fake-positions branch August 22, 2024 13:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@picnixz@iritkatriel