Commit 861cb815 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.29.x'

parents dc56dec8 685f7a7e
...@@ -2061,7 +2061,7 @@ if VALUE is not None: ...@@ -2061,7 +2061,7 @@ if VALUE is not None:
cdef object __pyx_result cdef object __pyx_result
if __pyx_checksum not in %(checksums)s: if __pyx_checksum not in %(checksums)s:
from pickle import PickleError as __pyx_PickleError from pickle import PickleError as __pyx_PickleError
raise __pyx_PickleError, "Incompatible checksums (%%s vs %(checksums)s = (%(members)s))" %% __pyx_checksum raise __pyx_PickleError, "Incompatible checksums (0x%%x vs %(checksums)s = (%(members)s))" %% __pyx_checksum
__pyx_result = %(class_name)s.__new__(__pyx_type) __pyx_result = %(class_name)s.__new__(__pyx_type)
if __pyx_state is not None: if __pyx_state is not None:
%(unpickle_func_name)s__set_state(<%(class_name)s> __pyx_result, __pyx_state) %(unpickle_func_name)s__set_state(<%(class_name)s> __pyx_result, __pyx_state)
......
...@@ -62,9 +62,6 @@ cdef class B: ...@@ -62,9 +62,6 @@ cdef class B:
def __reduce__(self): def __reduce__(self):
return makeObj, (type(self), {'x': self.x, 'y': self.y}) return makeObj, (type(self), {'x': self.x, 'y': self.y})
def __eq__(self, other):
return isinstance(other, B) and (<B>other).x == self.x and (<B>other).y == self.y
def makeObj(obj_type, kwds): def makeObj(obj_type, kwds):
return obj_type(**kwds) return obj_type(**kwds)
...@@ -119,6 +116,14 @@ cdef class DefaultReduceSubclass(DefaultReduce): ...@@ -119,6 +116,14 @@ cdef class DefaultReduceSubclass(DefaultReduce):
def __repr__(self): def __repr__(self):
return "DefaultReduceSubclass(i=%s, s=%r, x=%s)" % (self.i, self.s, self.x) return "DefaultReduceSubclass(i=%s, s=%r, x=%s)" % (self.i, self.s, self.x)
def __eq__(self, other):
return (
isinstance(other, DefaultReduceSubclass) and
(<DefaultReduceSubclass>other).i == self.i and
(<DefaultReduceSubclass>other).s == self.s and
(<DefaultReduceSubclass>other).x == self.x
)
cdef class result(DefaultReduceSubclass): cdef class result(DefaultReduceSubclass):
""" """
...@@ -311,9 +316,10 @@ if sys.version_info[:2] >= (3, 5): ...@@ -311,9 +316,10 @@ if sys.version_info[:2] >= (3, 5):
# Pickled with Cython 0.29.28 (using MD5 for the checksum). # Pickled with Cython 0.29.28 (using MD5 for the checksum).
OLD_MD5_PICKLE = b'''\ OLD_MD5_PICKLE = b'''\
\x80\x04\x95:\x00\x00\x00\x00\x00\x00\x00\x8c\rreduce_pickle\ \x80\x04\x95t\x00\x00\x00\x00\x00\x00\x00\x8c\rreduce_pickle\
\x94\x8c\x07makeObj\x94\x93\x94h\x00\x8c\x01B\x94\x93\x94}\ \x94\x8c$__pyx_unpickle_DefaultReduceSubclass\x94\x93\x94h\x00\x8c\x15\
\x94(\x8c\x01x\x94K%\x8c\x01y\x94M\x85\x01u\x86\x94R\x94.\ DefaultReduceSubclass\x94\x93\x94J\x8eYi\x08N\x87\x94R\x94K\x0b\x8c\x03\
abc\x94G?\xf8\x00\x00\x00\x00\x00\x00\x87\x94b.\
''' '''
try: try:
...@@ -325,6 +331,6 @@ else: ...@@ -325,6 +331,6 @@ else:
""" """
>>> import pickle >>> import pickle
>>> b = pickle.loads(OLD_MD5_PICKLE) >>> b = pickle.loads(OLD_MD5_PICKLE)
>>> b == B(x=37, y=389) or b >>> b == DefaultReduceSubclass(i=11, s='abc', x=1.5) or b
True True
""" """
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment