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
9ecd742d
Commit
9ecd742d
authored
Feb 12, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix type inference tests for int types.
parent
7a5d3565
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
Cython/Compiler/TypeInference.py
Cython/Compiler/TypeInference.py
+2
-0
tests/run/type_inference.pyx
tests/run/type_inference.pyx
+21
-2
No files found.
Cython/Compiler/TypeInference.py
View file @
9ecd742d
...
...
@@ -164,6 +164,8 @@ class MarkOverflowingArithmatic(CythonTransform):
visit_UnaryMinusNode
=
visit_dangerous_node
visit_InPlaceAssignmentNode
=
visit_dangerous_node
visit_Node
=
visit_safe_node
...
...
tests/run/type_inference.pyx
View file @
9ecd742d
...
...
@@ -251,10 +251,29 @@ def safe_only():
"""
a
=
1.0
assert
typeof
(
a
)
==
"double"
,
typeof
(
c
)
b
=
1
assert
typeof
(
b
)
==
"
Python object
"
,
typeof
(
b
)
b
=
1
;
assert
typeof
(
b
)
==
"
long
"
,
typeof
(
b
)
c
=
MyType
()
assert
typeof
(
c
)
==
"MyType"
,
typeof
(
c
)
for
i
in
range
(
10
):
pass
assert
typeof
(
i
)
==
"long"
,
typeof
(
i
)
d
=
1
res
=
~
d
assert
typeof
(
d
)
==
"long"
,
typeof
(
d
)
# potentially overflowing arithmatic
e
=
1
e
+=
1
assert
typeof
(
e
)
==
"Python object"
,
typeof
(
e
)
f
=
1
res
=
f
*
10
assert
typeof
(
f
)
==
"Python object"
,
typeof
(
f
)
g
=
1
res
=
10
*
(
~
g
)
assert
typeof
(
g
)
==
"Python object"
,
typeof
(
g
)
for
j
in
range
(
10
):
res
=
-
j
assert
typeof
(
j
)
==
"Python object"
,
typeof
(
j
)
@
infer_types
(
None
)
def
args_tuple_keywords
(
*
args
,
**
kwargs
):
...
...
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