◐ Shell
clean mode source ↗

gh-105481: reduce repetition in opcode metadata generation code by iritkatriel · Pull Request #107942 · python/cpython

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

gvanrossum

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) {")

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.

Labels