diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2023-02-27 18:53:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-27 18:53:22 (GMT) |
commit | 4f3786b7616dd464242b88ad6914053d409fe9d2 (patch) | |
tree | 6bd17c96e33920a7e2e0e91b53adf65886e2bae7 /Objects/clinic | |
parent | bb0cf8fd60e71581a90179af63e60e8704c3814b (diff) | |
download | cpython-4f3786b7616dd464242b88ad6914053d409fe9d2.zip cpython-4f3786b7616dd464242b88ad6914053d409fe9d2.tar.gz cpython-4f3786b7616dd464242b88ad6914053d409fe9d2.tar.bz2 |
gh-101773: Optimize creation of Fractions in private methods (#101780)
This PR adds a private `Fraction._from_coprime_ints` classmethod for internal creations of `Fraction` objects, replacing the use of `_normalize=False` in the existing constructor. This speeds up creation of `Fraction` objects arising from calculations. The `_normalize` argument to the `Fraction` constructor has been removed.
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Diffstat (limited to 'Objects/clinic')
0 files changed, 0 insertions, 0 deletions