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
62410bbe
Commit
62410bbe
authored
Oct 09, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more type inference tests
parent
e1f1152a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
tests/run/type_inference.pyx
tests/run/type_inference.pyx
+15
-0
No files found.
tests/run/type_inference.pyx
View file @
62410bbe
...
...
@@ -62,6 +62,15 @@ def cascade():
e
=
a
+
b
+
c
+
d
assert
typeof
(
e
)
==
"double"
def
cascaded_assignment
():
a
=
b
=
c
=
d
=
1.0
assert
typeof
(
a
)
==
"double"
assert
typeof
(
b
)
==
"double"
assert
typeof
(
c
)
==
"double"
assert
typeof
(
d
)
==
"double"
e
=
a
+
b
+
c
+
d
assert
typeof
(
e
)
==
"double"
def
increment
():
a
=
5
a
+=
1
...
...
@@ -71,10 +80,16 @@ def loop():
for
a
in
range
(
10
):
pass
assert
typeof
(
a
)
==
"long"
b
=
1.0
for
b
in
range
(
5
):
pass
assert
typeof
(
b
)
==
"double"
for
c
from
0
<=
c
<
10
by
.
5
:
pass
assert
typeof
(
c
)
==
"double"
for
d
in
range
(
0
,
10L
,
2
):
pass
assert
typeof
(
a
)
==
"long"
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