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