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
Gwenaël Samain
cython
Commits
c31fd30c
Commit
c31fd30c
authored
May 15, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into transfered_type_casting
parents
01fd4fe4
d171c28d
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
247 additions
and
17 deletions
+247
-17
.travis.yml
.travis.yml
+0
-1
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+3
-1
Cython/Utility/ObjectHandling.c
Cython/Utility/ObjectHandling.c
+19
-10
docs/src/reference/language_basics.rst
docs/src/reference/language_basics.rst
+2
-0
docs/src/tutorial/pxd_files.rst
docs/src/tutorial/pxd_files.rst
+2
-0
docs/src/userguide/language_basics.rst
docs/src/userguide/language_basics.rst
+221
-5
No files found.
.travis.yml
View file @
c31fd30c
...
...
@@ -80,7 +80,6 @@ matrix:
allow_failures
:
-
python
:
pypy
-
python
:
pypy3
-
python
:
3.7-dev
exclude
:
-
python
:
pypy
env
:
BACKEND=cpp
...
...
Cython/Utility/CythonFunction.c
View file @
c31fd30c
...
...
@@ -47,6 +47,8 @@ typedef struct {
static
PyTypeObject
*
__pyx_CyFunctionType
=
0
;
#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
...
...
@@ -1255,7 +1257,7 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
return
PyClassMethod_New
(
method
);
}
#ifdef __Pyx_CyFunction_USED
else
if
(
__Pyx_
TypeCheck
(
method
,
__pyx_CyFunctionType
))
{
else
if
(
__Pyx_
CyFunction_Check
(
method
))
{
return
PyClassMethod_New
(
method
);
}
#endif
...
...
Cython/Utility/ObjectHandling.c
View file @
c31fd30c
...
...
@@ -338,10 +338,17 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
value
=
PyDict_GetItemWithError
(
d
,
key
);
if
(
unlikely
(
!
value
))
{
if
(
!
PyErr_Occurred
())
{
if
(
unlikely
(
PyTuple_Check
(
key
)))
{
// CPython interprets tuples as separate arguments => must wrap them in another tuple.
PyObject
*
args
=
PyTuple_Pack
(
1
,
key
);
if
(
likely
(
args
))
if
(
likely
(
args
))
{
PyErr_SetObject
(
PyExc_KeyError
,
args
);
Py_XDECREF
(
args
);
Py_DECREF
(
args
);
}
}
else
{
// Avoid tuple packing if possible.
PyErr_SetObject
(
PyExc_KeyError
,
key
);
}
}
return
NULL
;
}
...
...
@@ -1432,12 +1439,13 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me
descr
=
_PyType_Lookup
(
tp
,
name
);
if
(
likely
(
descr
!=
NULL
))
{
Py_INCREF
(
descr
);
if
(
likely
(
PyFunction_Check
(
descr
)
#if PY_MAJOR_VERSION >= 3
if
(
likely
(
PyFunction_Check
(
descr
)
||
(
Py_TYPE
(
descr
)
==
&
PyMethodDescr_Type
)))
#else
// "PyMethodDescr_Type" is not part of the C-API in Py2.
||
(
Py_TYPE
(
descr
)
==
&
PyMethodDescr_Type
)
if
(
likely
(
PyFunction_Check
(
descr
))
)
#endif
))
{
{
meth_found
=
1
;
}
else
{
f
=
Py_TYPE
(
descr
)
->
tp_descr_get
;
...
...
@@ -2227,10 +2235,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
}
#endif
#ifdef __Pyx_CyFunction_USED
if
(
likely
(
PyCFunction_Check
(
func
)
||
__Pyx_
TypeCheck
(
func
,
__pyx_CyFunctionType
)))
{
if
(
likely
(
PyCFunction_Check
(
func
)
||
__Pyx_
CyFunction_Check
(
func
)))
#else
if
(
likely
(
PyCFunction_Check
(
func
)))
{
if
(
likely
(
PyCFunction_Check
(
func
)))
#endif
{
if
(
likely
(
PyCFunction_GET_FLAGS
(
func
)
&
METH_NOARGS
))
{
// fast and simple case that we are optimising for
return
__Pyx_PyObject_CallMethO
(
func
,
NULL
);
...
...
docs/src/reference/language_basics.rst
View file @
c31fd30c
...
...
@@ -12,6 +12,8 @@ Language Basics
Cython File Types
=================
.. NOW IN USER GUIDE, DO NOT TOUCH
There are three file types in Cython:
* Implementation files carry a ``.pyx`` suffix
...
...
docs/src/tutorial/pxd_files.rst
View file @
c31fd30c
.. _pxd_files:
pxd files
=========
...
...
docs/src/userguide/language_basics.rst
View file @
c31fd30c
This diff is collapsed.
Click to expand it.
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