Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
861cb815
Commit
861cb815
authored
Mar 14, 2022
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
dc56dec8
685f7a7e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+1
-1
tests/run/reduce_pickle.pyx
tests/run/reduce_pickle.pyx
+13
-7
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
861cb815
...
...
@@ -2061,7 +2061,7 @@ if VALUE is not None:
cdef object __pyx_result
if __pyx_checksum not in %(checksums)s:
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)
if __pyx_state is not None:
%(unpickle_func_name)s__set_state(<%(class_name)s> __pyx_result, __pyx_state)
...
...
tests/run/reduce_pickle.pyx
View file @
861cb815
...
...
@@ -62,9 +62,6 @@ cdef class B:
def
__reduce__
(
self
):
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
):
return
obj_type
(
**
kwds
)
...
...
@@ -119,6 +116,14 @@ cdef class DefaultReduceSubclass(DefaultReduce):
def
__repr__
(
self
):
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
):
"""
...
...
@@ -311,9 +316,10 @@ if sys.version_info[:2] >= (3, 5):
# Pickled with Cython 0.29.28 (using MD5 for the checksum).
OLD_MD5_PICKLE
=
b'''
\
\
x80
\
x04
\
x95
:
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
x8c
\
r
reduce_pickle
\
\
x94
\
x8c
\
x07
makeObj
\
x94
\
x93
\
x94
h
\
x00
\
x8c
\
x01
B
\
x94
\
x93
\
x94
}
\
\
x94
(
\
x8c
\
x01
x
\
x94
K%
\
x8c
\
x01
y
\
x94
M
\
x85
\
x01
u
\
x86
\
x94
R
\
x94
.
\
\
x80
\
x04
\
x95
t
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
x8c
\
r
reduce_pickle
\
\
x94
\
x8c
$__pyx_unpickle_DefaultReduceSubclass
\
x94
\
x93
\
x94
h
\
x00
\
x8c
\
x15
\
DefaultReduceSubclass
\
x94
\
x93
\
x94
J
\
x8e
Yi
\
x08
N
\
x87
\
x94
R
\
x94
K
\
x0b
\
x8c
\
x03
\
abc
\
x94
G?
\
xf8
\
x00
\
x00
\
x00
\
x00
\
x00
\
x00
\
x87
\
x94
b.
\
'''
try
:
...
...
@@ -325,6 +331,6 @@ else:
"""
>>> import 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
"""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment