Skip to content
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

Classes with __slots__ ought to be specialized when constructing instances #128262

Open
Fidget-Spinner opened this issue Dec 25, 2024 · 0 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage type-feature A feature request or enhancement

Comments

@Fidget-Spinner
Copy link
Member

Fidget-Spinner commented Dec 25, 2024

Feature or enhancement

Proposal:

Right now simple classes have the CALL_ALLOC_AND_ENTER_INIT specialization when calling their constructor. This however, blocks classes with __slots__. I propose relaxing the requirement and allowing __slots__ classes to benefit from this specialization as well.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

@Fidget-Spinner Fidget-Spinner added the type-feature A feature request or enhancement label Dec 25, 2024
@picnixz picnixz added interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants