Classes with __slots__ ought to be specialized when constructing instances · Issue #128262 · python/cpython · GitHub
Skip to content

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

Description

@Fidget-Spinner

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions