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
Kirill Smelkov
cython
Commits
f1b90a19
Commit
f1b90a19
authored
Sep 30, 2008
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Cython] PATCH: population of builtin types for 'isinstance' optimization
parent
0c0037ca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+18
-7
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+11
-5
No files found.
Cython/Compiler/Builtin.py
View file @
f1b90a19
...
...
@@ -83,12 +83,16 @@ builtin_function_table = [
builtin_types_table
=
[
(
"type"
,
"PyType_Type"
,
[]),
# ("str", "PyBytes_Type", []),
(
"bool"
,
"PyBool_Type"
,
[]),
(
"int"
,
"PyInt_Type"
,
[]),
(
"long"
,
"PyLong_Type"
,
[]),
(
"float"
,
"PyFloat_Type"
,
[]),
(
"complex"
,
"PyComplex_Type"
,
[]),
(
"bytes"
,
"PyBytes_Type"
,
[]),
(
"str"
,
"PyString_Type"
,
[]),
(
"unicode"
,
"PyUnicode_Type"
,
[]),
(
"file"
,
"PyFile_Type"
,
[]),
# ("slice", "PySlice_Type", []),
# ("set", "PySet_Type", []),
(
"frozenset"
,
"PyFrozenSet_Type"
,
[]),
(
"tuple"
,
"PyTuple_Type"
,
[]),
...
...
@@ -100,6 +104,13 @@ builtin_types_table = [
(
"dict"
,
"PyDict_Type"
,
[(
"items"
,
"O"
,
"O"
,
"PyDict_Items"
),
(
"keys"
,
"O"
,
"O"
,
"PyDict_Keys"
),
(
"values"
,
"O"
,
"O"
,
"PyDict_Values"
)]),
(
"set"
,
"PySet_Type"
,
[]),
(
"frozenset"
,
"PyFrozenSet_Type"
,
[]),
(
"slice"
,
"PySlice_Type"
,
[]),
(
"file"
,
"PyFile_Type"
,
[]),
]
builtin_structs_table
=
[
...
...
Cython/Compiler/Symtab.py
View file @
f1b90a19
...
...
@@ -721,19 +721,25 @@ class BuiltinScope(Scope):
return self
builtin_entries = {
"
type
": ["
((
PyObject
*
)
&
PyType_Type
)
", py_object_type],
"
bool
": ["
((
PyObject
*
)
&
PyBool_Type
)
", py_object_type],
"
int
": ["
((
PyObject
*
)
&
PyInt_Type
)
", py_object_type],
"
long
": ["
((
PyObject
*
)
&
PyLong_Type
)
", py_object_type],
"
float
": ["
((
PyObject
*
)
&
PyFloat_Type
)
", py_object_type],
"
complex
":["
((
PyObject
*
)
&
PyComplex_Type
)
", py_object_type],
"
str
": ["
((
PyObject
*
)
&
PyBytes_Type
)
", py_object_type],
"
bytes
": ["
((
PyObject
*
)
&
PyBytes_Type
)
", py_object_type],
"
str
": ["
((
PyObject
*
)
&
PyString_Type
)
", py_object_type],
"
unicode
":["
((
PyObject
*
)
&
PyUnicode_Type
)
", py_object_type],
"
tuple
": ["
((
PyObject
*
)
&
PyTuple_Type
)
", py_object_type],
"
list
": ["
((
PyObject
*
)
&
PyList_Type
)
", py_object_type],
"
dict
": ["
((
PyObject
*
)
&
PyDict_Type
)
", py_object_type],
"
set
": ["
((
PyObject
*
)
&
PySet_Type
)
", py_object_type],
"
frozenset
": ["
((
PyObject
*
)
&
PyFrozenSet_Type
)
", py_object_type],
"
type
": ["
((
PyObject
*
)
&
PyType_Type
)
", py_object_type],
"
slice
": ["
((
PyObject
*
)
&
PySlice_Type
)
", py_object_type],
"
file
": ["
((
PyObject
*
)
&
PyFile_Type
)
", py_object_type],
...
...
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