gh-105481: reduce repetition in opcode metadata generation code by iritkatriel · Pull Request #107942 · python/cpython
-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters