Skip to content

gh-105481: reduce repetition in opcode metadata generation code - #107942

Merged
iritkatriel merged 2 commits into
python:mainfrom
iritkatriel:metadata
Aug 14, 2023
Merged

gh-105481: reduce repetition in opcode metadata generation code#107942
iritkatriel merged 2 commits into
python:mainfrom
iritkatriel:metadata

Conversation

@iritkatriel

@iritkatrieliritkatriel commented Aug 14, 2023

Copy link
Copy Markdown
Member

This will simplify adding more stuff to the metadata.

@gvanrossumgvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Optional suggestion.

with self.metadata_item(
f"int _PyOpcode_num_{direction}(int opcode, int oparg, bool jump)", "", ""
):
self.out.emit(" switch(opcode) {")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could use ‘with self.out.block()’ and indent() here instead of adding spaces to the statements.

@iritkatriel
iritkatriel enabled auto-merge (squash) August 14, 2023 18:03
@iritkatriel
iritkatriel merged commit 3974534 into python:mainAug 14, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@iritkatriel@gvanrossum@bedevere-bot