mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-44154: optimize Fraction pickling (GH-26186)
This commit is contained in:
parent
b3f65e819f
commit
b102dd598d
3 changed files with 5 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue