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
Kirill Smelkov
cython
Commits
07fcb24b
Commit
07fcb24b
authored
8 years ago
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:cython/cython
parents
cb6a9b0e
f6e9bcc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
tests/run/if_else_expr.pyx
tests/run/if_else_expr.pyx
+13
-0
No files found.
tests/run/if_else_expr.pyx
View file @
07fcb24b
...
...
@@ -9,6 +9,7 @@ cdef class Foo:
def
__repr__
(
self
):
return
'<Foo>'
cpdef
test_type_cast
(
Foo
obj
,
cond
):
"""
# Regression test: obj must be cast to (PyObject *) here
...
...
@@ -42,3 +43,15 @@ def test_charptr_coercion(x):
"""
cdef
char
*
s
=
b'abc'
if
x
else
b'def'
return
s
.
decode
(
'ascii'
)
def
test_syntax
():
"""
>>> test_syntax()
(0, 0, 0)
"""
# Py3 allows the 'else' keyword to directly follow a number
x
=
0
if
1
else
1
y
=
0
if
1.0
else
1
z
=
0
if
1.
else
1
return
x
,
y
,
z
This diff is collapsed.
Click to expand it.
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