From b102dd598dd2666b72e93ae53ae813d1e88f186c Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev <2155800+skirpichev@users.noreply.github.com> Date: Mon, 17 May 2021 10:20:02 +0300 Subject: bpo-44154: optimize Fraction pickling (GH-26186) --- Lib/fractions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/fractions.py') diff --git a/Lib/fractions.py b/Lib/fractions.py index 96047beb45..64a8959d7d 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: -- cgit v1.2.1