Skip to content

Optimize the Fraction class arithmetics for small components #91851

Closed
@skirpichev

Description

@skirpichev

After #24779 there are some speed regressions, which can be solved by using private attributes in magic methods.

Also, right now the fractions module code is using sometimes private attributes (_numerator and _denominator, e.g. in the __int__) and sometimes - public (numerator and denominator, e.g. in the __floor__). This looks not very consistent, at least.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    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