Commit 07fcb24b authored by Robert Bradshaw's avatar Robert Bradshaw

Merge branch 'master' of github.com:cython/cython

parents cb6a9b0e f6e9bcc2
......@@ -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 1else 1
y = 0 if 1.0else 1
z = 0 if 1.else 1
return x, y, z
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment