Commit ed37fcd8 authored by Robert Bradshaw's avatar Robert Bradshaw

Test and note for tuple types.

parent 137605d6
...@@ -13,6 +13,8 @@ Features added ...@@ -13,6 +13,8 @@ Features added
* ``PySlice_*()`` C-API functions are available from the ``cpython.slice`` * ``PySlice_*()`` C-API functions are available from the ``cpython.slice``
module. module.
* Anonymous C tuple types can be declared as (ctype1, ctype2, ...).
Bugs fixed Bugs fixed
---------- ----------
......
def convert(*o):
"""
>>> convert(1, 2)
(1, 2.0)
>>> convert(1)
Traceback (most recent call last):
...
TypeError: Expected a tuple of size 2, got tuple
>>> convert(1, 2, 3)
Traceback (most recent call last):
...
TypeError: Expected a tuple of size 2, got tuple
"""
cdef (int, double) xy = o
return xy
cpdef (int, double) ctuple_return_type(x, y):
"""
>>> ctuple_return_type(1, 2)
(1, 2.0)
"""
return x, y
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