Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
gvanrossum merged 4 commits intopython:mainfromjbower-fb:multiple-cases
Mar 4, 2023

Conversation

jbower-fb
Copy link
Contributor

@jbower-fbjbower-fb commentedFeb 18, 2023
edited by bedevere-bot
Loading

I'm not sure a NEWS blurb is needed as the generator is entirely new in 3.12 anyway.

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@arhadthedev
Copy link
Member

@gvanrossum@iritkatriel as authors ofcases_generator.

@gvanrossum
Copy link
Member

I would like to wait reviewing until I am back from my break, around 2/27.

jbower-fb reacted with thumbs up emoji

@gvanrossumgvanrossum self-requested a reviewFebruary 28, 2023 22:55
@gvanrossumgvanrossum self-assigned thisFeb 28, 2023
Copy link
Member

@gvanrossumgvanrossum left a 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(
Copy link
Member

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.)

jbower-fb reacted with thumbs up emoji
Copy link
ContributorAuthor

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();

@gvanrossum
Copy link
Member

gvanrossum commentedMar 3, 2023
edited
Loading

(In the future please don't force push. It makes things more complicated for the reviewer, and we squash commits at the end anyway.)

jbower-fb reacted with thumbs up emoji

Copy link
Member

@gvanrossumgvanrossum left a 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!

@jbower-fb
Copy link
ContributorAuthor

Great, thank you.

@gvanrossumgvanrossum merged commit8de59c1 intopython:mainMar 4, 2023
carljm added a commit to carljm/cpython that referenced this pull requestMar 4, 2023
* 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)
hugovk pushed a commit to hugovk/cpython that referenced this pull requestMar 6, 2023
@jbower-fbjbower-fb deleted the multiple-cases branchMay 1, 2023 22:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gvanrossumgvanrossumgvanrossum approved these changes

Assignees

@gvanrossumgvanrossum

Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@jbower-fb@bedevere-bot@arhadthedev@gvanrossum

[8]ページ先頭

©2009-2025 Movatter.jp