We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08bd191 commit f347f18Copy full SHA for f347f18
src/flint/fmpq.pyx
@@ -105,6 +105,9 @@ cdef class fmpq(flint_scalar):
105
numerator = property(numer)
106
denominator = property(denom)
107
108
+ def __reduce__(self):
109
+ return (fmpq, (int(self.p), int(self.q)))
110
+
111
def repr(self):
112
if self.q == 1:
113
return "fmpq(%s)" % self.p
src/flint/fmpz.pyx
@@ -99,6 +99,9 @@ cdef class fmpz(flint_scalar):
99
def denominator(self):
100
return fmpz(1)
101
102
103
+ return (fmpz, (int(self),))
104
# XXX: improve!
def __int__(self):
return fmpz_get_intlong(self.val)
0 commit comments