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
Boxiang Sun
cython
Commits
a5e1b89a
Commit
a5e1b89a
authored
Feb 24, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable builtin functions that conflict with type names
add dummy py_index for cdef arrays so subexprs valid
parent
24e2d102
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+15
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
a5e1b89a
...
...
@@ -1056,6 +1056,7 @@ class IndexNode(ExprNode):
self
.
type
=
py_object_type
self
.
is_temp
=
1
else
:
self
.
py_index
=
CloneNode
(
self
.
index
)
# so that it exists for subexpr processing
if
self
.
base
.
type
.
is_ptr
or
self
.
base
.
type
.
is_array
:
self
.
type
=
self
.
base
.
type
.
base_type
else
:
...
...
Cython/Compiler/Symtab.py
View file @
a5e1b89a
...
...
@@ -457,11 +457,13 @@ class BuiltinScope(Scope):
entry
.
is_builtin
=
1
return
entry
# TODO: built in functions conflict with built in types of same name...
builtin_functions
=
{
"hasattr"
:
[
"PyObject_HasAttrString"
,
c_int_type
,
(
py_object_type
,
c_char_ptr_type
)],
"cmp"
:
[
"PyObject_Compare"
,
c_int_type
,
(
py_object_type
,
py_object_type
),
None
,
True
],
"repr"
:
[
"PyObject_Repr"
,
py_object_type
,
(
py_object_type
,
),
0
],
"str"
:
[
"PyObject_Str"
,
py_object_type
,
(
py_object_type
,
),
0
],
#
"str": ["PyObject_Str", py_object_type, (py_object_type, ), 0],
"unicode"
:
[
"PyObject_Unicode"
,
py_object_type
,
(
py_object_type
,
),
0
],
"isinstance"
:
[
"PyObject_IsInstance"
,
c_int_type
,
(
py_object_type
,
py_object_type
),
-
1
],
"hash"
:
[
"PyObject_Hash"
,
c_long_type
,
(
py_object_type
,
),
-
1
,
True
],
...
...
@@ -469,6 +471,17 @@ class BuiltinScope(Scope):
"len"
:
[
"PyObject_Size"
,
c_py_ssize_t_type
,
(
py_object_type
,
),
-
1
],
"dir"
:
[
"PyObject_Dir"
,
py_object_type
,
(
py_object_type
,
),
0
],
"iter"
:
[
"PyObject_GetIter"
,
py_object_type
,
(
py_object_type
,
),
0
],
"abs"
:
[
"PyNumber_Absolute"
,
py_object_type
,
(
py_object_type
,
),
0
],
"divmod"
:
[
"PyNumber_Divmod"
,
py_object_type
,
(
py_object_type
,
py_object_type
),
0
],
"pow"
:
[
"PyNumber_Power"
,
py_object_type
,
(
py_object_type
,
py_object_type
,
py_object_type
),
0
],
# "int": ["PyNumber_Int", py_object_type, (py_object_type, ), 0],
# "long": ["PyNumber_Long", py_object_type, (py_object_type, ), 0],
# "float": ["PyNumber_Float", py_object_type, (py_object_type, ), 0],
# "list": ["PyNumber_List", py_object_type, (py_object_type, ), 0],
# "tuple": ["PySequence_Tuple", py_object_type, (py_object_type, ), 0],
}
class
ModuleScope
(
Scope
):
...
...
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