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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
c3e11181
Commit
c3e11181
authored
Dec 21, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use _PyDict_Pop() only when available (CPython 3.6+).
parent
5f4e51e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+3
-2
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+20
-0
No files found.
Cython/Compiler/Optimize.py
View file @
c3e11181
...
...
@@ -2931,8 +2931,9 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin,
return
self
.
_substitute_method_call
(
node
,
function
,
"_PyDict_Pop"
,
self
.
PyDict_Pop_func_type
,
'pop'
,
is_unbound_method
,
args
)
"__Pyx_PyDict_Pop"
,
self
.
PyDict_Pop_func_type
,
'pop'
,
is_unbound_method
,
args
,
utility_code
=
load_c_utility
(
'py_dict_pop'
))
Pyx_PyInt_BinopInt_func_type
=
PyrexTypes
.
CFuncType
(
PyrexTypes
.
py_object_type
,
[
...
...
Cython/Utility/Optimize.c
View file @
c3e11181
...
...
@@ -269,6 +269,26 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0)
/////////////// py_dict_pop.proto ///////////////
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3
#define __Pyx_PyDict_Pop(d, key, default_value) _PyDict_Pop(d, key, default_value)
#else
static
CYTHON_INLINE
PyObject
*
__Pyx_PyDict_Pop
(
PyObject
*
d
,
PyObject
*
key
,
PyObject
*
default_value
);
/*proto*/
#endif
/////////////// py_dict_pop ///////////////
#if !(CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3)
static
CYTHON_INLINE
PyObject
*
__Pyx_PyDict_Pop
(
PyObject
*
d
,
PyObject
*
key
,
PyObject
*
default_value
)
{
// 'default_value' can be NULL
return
PyObject_CallMethodObjArgs
(
d
,
PYIDENT
(
"pop"
),
key
,
default_value
);
}
#endif
/////////////// dict_iter.proto ///////////////
static
CYTHON_INLINE
PyObject
*
__Pyx_dict_iterator
(
PyObject
*
dict
,
int
is_dict
,
PyObject
*
method_name
,
...
...
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