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
25f8180e
Commit
25f8180e
authored
Jun 19, 2009
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get rid of string comparisons in classmethod utility code
parent
54b721d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+1
-2
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+8
-2
No files found.
Cython/Compiler/ModuleNode.py
View file @
25f8180e
...
@@ -588,8 +588,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -588,8 +588,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
'static char %s[] = "%s";'
%
(
code
.
putln
(
'static char %s[] = "%s";'
%
(
env
.
doc_cname
,
escape_byte_string
(
docstr
)))
env
.
doc_cname
,
escape_byte_string
(
docstr
)))
env
.
use_utility_code
(
streq_utility_code
)
# XXX this is a mess
# XXX this is a mess
for
utility_code
in
PyrexTypes
.
c_int_from_py_function
.
specialize_list
:
for
utility_code
in
PyrexTypes
.
c_int_from_py_function
.
specialize_list
:
env
.
use_utility_code
(
utility_code
)
env
.
use_utility_code
(
utility_code
)
...
@@ -1556,6 +1554,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1556,6 +1554,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"static void %s(void); /*proto*/"
%
Naming
.
fileinit_cname
)
code
.
putln
(
"static void %s(void); /*proto*/"
%
Naming
.
fileinit_cname
)
def
generate_import_star
(
self
,
env
,
code
):
def
generate_import_star
(
self
,
env
,
code
):
env
.
use_utility_code
(
streq_utility_code
)
code
.
putln
()
code
.
putln
()
code
.
putln
(
"char* %s_type_names[] = {"
%
Naming
.
import_star
)
code
.
putln
(
"char* %s_type_names[] = {"
%
Naming
.
import_star
)
for
name
,
entry
in
env
.
entries
.
items
():
for
name
,
entry
in
env
.
entries
.
items
():
...
...
Cython/Compiler/Symtab.py
View file @
25f8180e
...
@@ -1583,8 +1583,14 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/
...
@@ -1583,8 +1583,14 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/
impl
=
"""
impl
=
"""
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
/* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */
/* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */
/* if (!PyObject_TypeCheck(method, &PyMethodDescr_Type)) { */
static PyTypeObject *methoddescr_type = NULL;
if (__Pyx_StrEq(Py_TYPE(method)->tp_name, "method_descriptor")) { /* cdef classes */
if (methoddescr_type == NULL) {
PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append");
if (!meth) return NULL;
methoddescr_type = Py_TYPE(meth);
Py_DECREF(meth);
}
if (PyObject_TypeCheck(method, methoddescr_type)) { /* cdef classes */
PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
return PyDescr_NewClassMethod(descr->d_type, descr->d_method);
return PyDescr_NewClassMethod(descr->d_type, descr->d_method);
}
}
...
...
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