projects
/
cython.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge branch 'purepy-shadow'
[cython.git]
/
tests
/
run
/
ifelseexpr_T267.pyx
1
# ticket: 267
2
3
"""
4
>>> constants(4)
5
1
6
>>> constants(5)
7
10
8
>>> temps(4)
9
1
10
>>> temps(5)
11
10
12
>>> nested(1)
13
1
14
>>> nested(2)
15
2
16
>>> nested(3)
17
3
18
"""
19
20
def ident(x): return x
21
22
def constants(x):
23
a = 1 if x < 5 else 10
24
return a
25
26
def temps(x):
27
return ident(1) if ident(x) < ident(5) else ident(10)
28
29
def nested(x):
30
return 1 if x == 1 else (2 if x == 2 else 3)