summaryrefslogtreecommitdiffstats
path: root/Lib/fractions.py
diff options
context:
space:
mode:
authorSergey B Kirpichev <2155800+skirpichev@users.noreply.github.com>2021-05-17 07:20:02 (GMT)
committerGitHub <noreply@github.com>2021-05-17 07:20:02 (GMT)
commitb102dd598dd2666b72e93ae53ae813d1e88f186c (patch)
tree06d92560ced1302efbd45e4317fc90282aa8905f /Lib/fractions.py
parentb3f65e819f552561294a66e350a9f5a3131f7df2 (diff)
downloadcpython-b102dd598dd2666b72e93ae53ae813d1e88f186c.zip
cpython-b102dd598dd2666b72e93ae53ae813d1e88f186c.tar.gz
cpython-b102dd598dd2666b72e93ae53ae813d1e88f186c.tar.bz2
bpo-44154: optimize Fraction pickling (GH-26186)
Diffstat (limited to 'Lib/fractions.py')
-rw-r--r--Lib/fractions.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/fractions.py b/Lib/fractions.py
index 96047be..64a8959 100644
--- a/Lib/fractions.py
+++ b/Lib/fractions.py
@@ -735,7 +735,7 @@ class Fraction(numbers.Rational):
# support for pickling, copy, and deepcopy
def __reduce__(self):
- return (self.__class__, (str(self),))
+ return (self.__class__, (self._numerator, self._denominator))
def __copy__(self):
if type(self) == Fraction: