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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
0f02f513
Commit
0f02f513
authored
Mar 14, 2010
by
Craig Citro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specal -> special
parent
5724798e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+1
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-3
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+6
-6
No files found.
Cython/Compiler/Code.py
View file @
0f02f513
...
@@ -40,7 +40,7 @@ class UtilityCode(object):
...
@@ -40,7 +40,7 @@ class UtilityCode(object):
# Dicts aren't hashable...
# Dicts aren't hashable...
if
pyrex_type
is
not
None
:
if
pyrex_type
is
not
None
:
data
[
'type'
]
=
pyrex_type
.
declaration_code
(
''
)
data
[
'type'
]
=
pyrex_type
.
declaration_code
(
''
)
data
[
'type_name'
]
=
pyrex_type
.
specalization_name
()
data
[
'type_name'
]
=
pyrex_type
.
spec
i
alization_name
()
key
=
data
.
items
();
key
.
sort
();
key
=
tuple
(
key
)
key
=
data
.
items
();
key
.
sort
();
key
=
tuple
(
key
)
try
:
try
:
return
self
.
_cache
[
key
]
return
self
.
_cache
[
key
]
...
...
Cython/Compiler/ExprNodes.py
View file @
0f02f513
...
@@ -2062,7 +2062,7 @@ class IndexNode(ExprNode):
...
@@ -2062,7 +2062,7 @@ class IndexNode(ExprNode):
index_code
=
self
.
index
.
py_result
()
index_code
=
self
.
index
.
py_result
()
if
self
.
base
.
type
is
dict_type
:
if
self
.
base
.
type
is
dict_type
:
function
=
"PyDict_SetItem"
function
=
"PyDict_SetItem"
# It would seem that we could specalized lists/tuples, but that
# It would seem that we could spec
i
alized lists/tuples, but that
# shouldn't happen here.
# shouldn't happen here.
# Both PyList_SetItem PyTuple_SetItem and a Py_ssize_t as input,
# Both PyList_SetItem PyTuple_SetItem and a Py_ssize_t as input,
# not a PyObject*, and bad conversion here would give the wrong
# not a PyObject*, and bad conversion here would give the wrong
...
@@ -5091,7 +5091,7 @@ class DivNode(NumBinopNode):
...
@@ -5091,7 +5091,7 @@ class DivNode(NumBinopNode):
return
"(%s / %s)"
%
(
op1
,
op2
)
return
"(%s / %s)"
%
(
op1
,
op2
)
else
:
else
:
return
"__Pyx_div_%s(%s, %s)"
%
(
return
"__Pyx_div_%s(%s, %s)"
%
(
self
.
type
.
specalization_name
(),
self
.
type
.
spec
i
alization_name
(),
self
.
operand1
.
result
(),
self
.
operand1
.
result
(),
self
.
operand2
.
result
())
self
.
operand2
.
result
())
...
@@ -5136,7 +5136,7 @@ class ModNode(DivNode):
...
@@ -5136,7 +5136,7 @@ class ModNode(DivNode):
self
.
operand2
.
result
())
self
.
operand2
.
result
())
else
:
else
:
return
"__Pyx_mod_%s(%s, %s)"
%
(
return
"__Pyx_mod_%s(%s, %s)"
%
(
self
.
type
.
specalization_name
(),
self
.
type
.
spec
i
alization_name
(),
self
.
operand1
.
result
(),
self
.
operand1
.
result
(),
self
.
operand2
.
result
())
self
.
operand2
.
result
())
...
...
Cython/Compiler/PyrexTypes.py
View file @
0f02f513
...
@@ -20,7 +20,7 @@ class BaseType(object):
...
@@ -20,7 +20,7 @@ class BaseType(object):
def
cast_code
(
self
,
expr_code
):
def
cast_code
(
self
,
expr_code
):
return
"((%s)%s)"
%
(
self
.
declaration_code
(
""
),
expr_code
)
return
"((%s)%s)"
%
(
self
.
declaration_code
(
""
),
expr_code
)
def
specalization_name
(
self
):
def
spec
i
alization_name
(
self
):
return
self
.
declaration_code
(
""
).
replace
(
" "
,
"__"
)
return
self
.
declaration_code
(
""
).
replace
(
" "
,
"__"
)
def
base_declaration_code
(
self
,
base_code
,
entity_code
):
def
base_declaration_code
(
self
,
base_code
,
entity_code
):
...
@@ -900,16 +900,16 @@ class CComplexType(CNumericType):
...
@@ -900,16 +900,16 @@ class CComplexType(CNumericType):
if
real_type
.
is_typedef
and
real_type
.
typedef_is_external
:
if
real_type
.
is_typedef
and
real_type
.
typedef_is_external
:
# The below is not actually used: Coercions are currently disabled
# The below is not actually used: Coercions are currently disabled
# so that complex types of external types can not be created
# so that complex types of external types can not be created
self
.
funcsuffix
=
"_%s"
%
real_type
.
specalization_name
()
self
.
funcsuffix
=
"_%s"
%
real_type
.
spec
i
alization_name
()
elif
hasattr
(
real_type
,
'math_h_modifier'
):
elif
hasattr
(
real_type
,
'math_h_modifier'
):
self
.
funcsuffix
=
real_type
.
math_h_modifier
self
.
funcsuffix
=
real_type
.
math_h_modifier
else
:
else
:
self
.
funcsuffix
=
"_%s"
%
real_type
.
specalization_name
()
self
.
funcsuffix
=
"_%s"
%
real_type
.
spec
i
alization_name
()
self
.
real_type
=
real_type
self
.
real_type
=
real_type
CNumericType
.
__init__
(
self
,
real_type
.
rank
+
0.5
,
real_type
.
signed
)
CNumericType
.
__init__
(
self
,
real_type
.
rank
+
0.5
,
real_type
.
signed
)
self
.
binops
=
{}
self
.
binops
=
{}
self
.
from_parts
=
"%s_from_parts"
%
self
.
specalization_name
()
self
.
from_parts
=
"%s_from_parts"
%
self
.
spec
i
alization_name
()
self
.
default_value
=
"%s(0, 0)"
%
self
.
from_parts
self
.
default_value
=
"%s(0, 0)"
%
self
.
from_parts
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
...
@@ -944,7 +944,7 @@ class CComplexType(CNumericType):
...
@@ -944,7 +944,7 @@ class CComplexType(CNumericType):
return
self
.
base_declaration_code
(
base
,
entity_code
)
return
self
.
base_declaration_code
(
base
,
entity_code
)
def
sign_and_name
(
self
):
def
sign_and_name
(
self
):
real_type_name
=
self
.
real_type
.
specalization_name
()
real_type_name
=
self
.
real_type
.
spec
i
alization_name
()
real_type_name
=
real_type_name
.
replace
(
'long__double'
,
'long_double'
)
real_type_name
=
real_type_name
.
replace
(
'long__double'
,
'long_double'
)
return
Naming
.
type_prefix
+
real_type_name
+
"_complex"
return
Naming
.
type_prefix
+
real_type_name
+
"_complex"
...
@@ -1010,7 +1010,7 @@ class CComplexType(CNumericType):
...
@@ -1010,7 +1010,7 @@ class CComplexType(CNumericType):
self
,
self
,
real_type
=
self
.
real_type
.
declaration_code
(
''
),
real_type
=
self
.
real_type
.
declaration_code
(
''
),
m
=
self
.
funcsuffix
))
m
=
self
.
funcsuffix
))
self
.
from_py_function
=
"__Pyx_PyComplex_As_"
+
self
.
specalization_name
()
self
.
from_py_function
=
"__Pyx_PyComplex_As_"
+
self
.
spec
i
alization_name
()
return
True
return
True
def
lookup_op
(
self
,
nargs
,
op
):
def
lookup_op
(
self
,
nargs
,
op
):
...
...
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