Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
Fidget-Spinner opened this issue Dec 25, 2024 · 0 comments
Closed
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
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
# for free to join this conversation on GitHub. Already have an account? # 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