Skip to content

Remove special syntax for super(X) = A + B in favor of macro(X) = A + JOIN + B #508

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

Closed
wants to merge 1 commit into from

Conversation

gvanrossum
Copy link
Collaborator

@gvanrossum gvanrossum commented Dec 8, 2022

This can now be expressed as a macro using A + JOIN + B.

See also python/cpython#100124 and #507.

This can now be expressed as a macro using A + JOIN + B.
@markshannon
Copy link
Member

Implementing superinstructions as A + JOIN + B probably make sense, but I'd rather have the DSL be explicit about superinstructions.

Parsing superinstructions should be simple. Do we gain much by removing that code?

@gvanrossum
Copy link
Collaborator Author

Implementing superinstructions as A + JOIN + B probably make sense, but I'd rather have the DSL be explicit about superinstructions.

I guess we could rename JOIN to SUPER, would that be explicit enough?

Parsing superinstructions should be simple. Do we gain much by removing that code?

You can see for yourself in python/cpython@eadca51. That commit removes about 80 lines net, or about 6% of the generator and parser. About 60 lines are removed from the generator, about 20 from the parser proper.

See also #495 which asks a related question.

@gvanrossum
Copy link
Collaborator Author

FWIW after reading Brandt's review of the cpython PR I'm rather hesitant about this.

@gvanrossum gvanrossum changed the title Remove special syntax for super() Remove special syntax for super(X) = A + B in favor of macro(X) = A + JOIN + B Dec 12, 2022
@gvanrossum
Copy link
Collaborator Author

Off-line we decided not to do this.

@gvanrossum gvanrossum closed this Dec 12, 2022
@gvanrossum gvanrossum deleted the super-is-macro branch February 25, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants