Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
gh-102021 : Allow multiple input files for interpreter loop generator#102022
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
bedevere-bot commentedFeb 18, 2023
Most changes to Pythonrequire a NEWS entry. Please add it using theblurb_it web app or theblurb command-line tool. |
@gvanrossum@iritkatriel as authors of |
I would like to wait reviewing until I am back from my break, around 2/27. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for doing this! I have a few suggestions, feel free to push back!
Uh oh!
There was an error while loading.Please reload this page.
instrs: dict[str, Instruction] # Includes ops | ||
supers: dict[str, parser.Super] | ||
super_instrs: dict[str, SuperInstruction] | ||
macros: dict[str, parser.Macro] | ||
macro_instrs: dict[str, MacroInstruction] | ||
families: dict[str, parser.Family] | ||
def every_thing(self) -> Iterable[parser.InstDef | parser.Super | parser.Macro]: | ||
return itertools.chain( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not a big fan of itertools.chain. Maybe make this a generator?
I also noticed this is causing the output to be emitted in a different order again. But I quite like having the generated instructions in the same order as they occur in the input. Could you restore that behavior? (I understand that it's a little tricky due to overrides. Ideally there would be a comment left in the output for instructions that are overridden by later ones.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Okay, I've changed things now so the output will retain the definition order and if there are overrides they'll look something like this:
... // TARGET(NOP) overridden by later definition... // Override TARGET(NOP) { DISPATCH();
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
gvanrossum commentedMar 3, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
(In the future please don't force push. It makes things more complicated for the reviewer, and we squash commits at the end anyway.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LG!
I'll apply the small correction to the metadata header comment, wait for tests to pass again, and merge it. Thanks!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Great, thank you. |
Uh oh!
There was an error while loading.Please reload this page.
* main:pythongh-102021 : Allow multiple input files for interpreter loop generator (python#102022) Add import of `unittest.mock.Mock` in documentation (python#102346)pythongh-102383: [docs] Arguments of `PyObject_CopyData` are `PyObject *` (python#102390)pythongh-101754: Document that Windows converts keys in `os.environ` to uppercase (pythonGH-101840)pythongh-102324: Improve tests of `typing.override` (python#102325)
…erator (python#102022)The input files no longer use `-i`.
Uh oh!
There was an error while loading.Please reload this page.
I'm not sure a NEWS blurb is needed as the generator is entirely new in 3.12 anyway.