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
e2e70027
Commit
e2e70027
authored
Oct 19, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid some more accidental type coercion helper code generation
parent
184f7edc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+11
-3
No files found.
Cython/Compiler/PyrexTypes.py
View file @
e2e70027
...
@@ -1251,6 +1251,9 @@ class CConstType(BaseType):
...
@@ -1251,6 +1251,9 @@ class CConstType(BaseType):
def
deduce_template_params
(
self
,
actual
):
def
deduce_template_params
(
self
,
actual
):
return
self
.
const_base_type
.
deduce_template_params
(
actual
)
return
self
.
const_base_type
.
deduce_template_params
(
actual
)
def
can_coerce_to_pyobject
(
self
,
env
):
return
self
.
const_base_type
.
can_coerce_to_pyobject
(
env
)
def
create_to_py_utility_code
(
self
,
env
):
def
create_to_py_utility_code
(
self
,
env
):
if
self
.
const_base_type
.
create_to_py_utility_code
(
env
):
if
self
.
const_base_type
.
create_to_py_utility_code
(
env
):
self
.
to_py_function
=
self
.
const_base_type
.
to_py_function
self
.
to_py_function
=
self
.
const_base_type
.
to_py_function
...
@@ -1420,6 +1423,9 @@ class CIntType(CNumericType):
...
@@ -1420,6 +1423,9 @@ class CIntType(CNumericType):
from_py_function
=
None
from_py_function
=
None
exception_value
=
-
1
exception_value
=
-
1
def
can_coerce_to_pyobject
(
self
,
env
):
return
True
def
create_to_py_utility_code
(
self
,
env
):
def
create_to_py_utility_code
(
self
,
env
):
if
type
(
self
).
to_py_function
is
None
:
if
type
(
self
).
to_py_function
is
None
:
self
.
to_py_function
=
"__Pyx_PyInt_From_"
+
self
.
specialization_name
()
self
.
to_py_function
=
"__Pyx_PyInt_From_"
+
self
.
specialization_name
()
...
@@ -1765,6 +1771,9 @@ class CComplexType(CNumericType):
...
@@ -1765,6 +1771,9 @@ class CComplexType(CNumericType):
is_float
=
self
.
real_type
.
is_float
))
is_float
=
self
.
real_type
.
is_float
))
return
True
return
True
def
can_coerce_to_pyobject
(
self
,
env
):
return
True
def
create_to_py_utility_code
(
self
,
env
):
def
create_to_py_utility_code
(
self
,
env
):
env
.
use_utility_code
(
complex_real_imag_utility_code
)
env
.
use_utility_code
(
complex_real_imag_utility_code
)
env
.
use_utility_code
(
complex_to_py_utility_code
)
env
.
use_utility_code
(
complex_to_py_utility_code
)
...
@@ -2397,8 +2406,7 @@ class CFuncType(CType):
...
@@ -2397,8 +2406,7 @@ class CFuncType(CType):
# is exempt from compatibility checking (the proper check
# is exempt from compatibility checking (the proper check
# is performed elsewhere).
# is performed elsewhere).
for
i
in
range
(
as_cmethod
,
nargs
):
for
i
in
range
(
as_cmethod
,
nargs
):
if
not
self
.
args
[
i
].
type
.
same_as
(
if
not
self
.
args
[
i
].
type
.
same_as
(
other_type
.
args
[
i
].
type
):
other_type
.
args
[
i
].
type
):
return
0
return
0
if
self
.
has_varargs
!=
other_type
.
has_varargs
:
if
self
.
has_varargs
!=
other_type
.
has_varargs
:
return
0
return
0
...
...
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