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
39aa2269
Commit
39aa2269
authored
Apr 28, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case
parent
c333ff19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
16 deletions
+37
-16
tests/run/ifelseexpr_T267.pyx
tests/run/ifelseexpr_T267.pyx
+37
-16
No files found.
tests/run/ifelseexpr_T267.pyx
View file @
39aa2269
# mode: run
# tag: condexpr
# ticket: 267
# ticket: 267
"""
cimport
cython
>>> constants(4)
1
>>> constants(5)
10
>>> temps(4)
1
>>> temps(5)
10
>>> nested(1)
1
>>> nested(2)
2
>>> nested(3)
3
"""
def
ident
(
x
):
return
x
def
ident
(
x
):
return
x
def
constants
(
x
):
def
constants
(
x
):
"""
>>> constants(4)
1
>>> constants(5)
10
"""
a
=
1
if
x
<
5
else
10
a
=
1
if
x
<
5
else
10
return
a
return
a
def
temps
(
x
):
def
temps
(
x
):
"""
>>> temps(4)
1
>>> temps(5)
10
"""
return
ident
(
1
)
if
ident
(
x
)
<
ident
(
5
)
else
ident
(
10
)
return
ident
(
1
)
if
ident
(
x
)
<
ident
(
5
)
else
ident
(
10
)
def
nested
(
x
):
def
nested
(
x
):
"""
>>> nested(1)
1
>>> nested(2)
2
>>> nested(3)
3
"""
return
1
if
x
==
1
else
(
2
if
x
==
2
else
3
)
return
1
if
x
==
1
else
(
2
if
x
==
2
else
3
)
def
const_true
():
"""
>>> const_true()
1
"""
return
1
if
1
==
1
else
2
def
const_false
():
"""
>>> const_false()
2
"""
return
1
if
1
!=
1
else
2
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