-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-123881: make compiler add the .generic_base base class without constructing AST nodes #123883
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
031c697
add action helper for ClassDef
iritkatriel 6547576
add .generic_base to bases in AST so compiler doesn't need to do it
iritkatriel 412fe99
update tests
iritkatriel 781fc79
add news
iritkatriel 8200b77
add whatsnew entry
iritkatriel d75532a
Revert "add whatsnew entry"
iritkatriel 22228eb
Revert "add news"
iritkatriel 4831765
Revert "update tests"
iritkatriel 5218173
Revert "add .generic_base to bases in AST so compiler doesn't need to…
iritkatriel 0e52c0f
Revert "add action helper for ClassDef"
iritkatriel 341f8a5
keep it in the compiler
iritkatriel e92c432
handle stararg case
iritkatriel 40046c1
Merge remote-tracking branch 'upstream/main' into generic
iritkatriel 4611b92
the compiler struct no longer needs the arena
iritkatriel c6c3cff
Merge branch 'main' into generic
iritkatriel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add .generic_base to bases in AST so compiler doesn't need to do it
- Loading branch information
commit 654757698f47007609a8c0cbc3285c1d41d7a4c0
There are no files selected for viewing
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
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If it's important to you to remove the code creating a fake AST node here, you could instead add an extra argument to
codegen_call_helperthat is usually NULL and maps to an extra argument to add at the end of the list. I think I did that initially while working on PEP 695, but it seemed worse than creating a new virtual asdl_seq as the current code does. (Possibly you were involved in discussing that in person, don't remember exactly.)But I'd like to keep the extra base class as an implementation detail in the compiler, not something that gets exposed in the AST layer.
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.
Ok, I'll try something like that, should be quite simple.
It's possible I was involved in the discussion at the time, I don't remember the details.
I think it would be better if the compiler didn't need to know how to create AST nodes. (I take your point about it not modifying the AST, I'll correct the wording in the issue)
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 found back the discussion from last time: #103764 (comment).