-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-102021 : Allow multiple input files for interpreter loop generator #102022
Conversation
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb 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!
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();
d8c3165
to
c8495cd
Compare
(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!
Great, thank you. |
* 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`.
I'm not sure a NEWS blurb is needed as the generator is entirely new in 3.12 anyway.