1# mode: run
2
3def f(x, y):
4    x = y
5
6
7cdef void g(int i, float f, char *p):
8    f = i
9
10
11cdef h(int i, obj):
12    i = obj
13
14
15def z(a, b, c):
16    """
17    >>> z(1,9.2, b'test')
18    """
19    f(a, b)
20    f(a, b,)
21    g(1, 2.0, "spam")
22    g(a, b, c)
23
24
25def fail0(a, b):
26    """
27    >>> fail0(1,2)
28    Traceback (most recent call last):
29    TypeError: f() takes exactly 2 positional arguments (0 given)
30    """
31    f()
32
33
34def fail1(a, b):
35    """
36    >>> fail1(1,2)
37    Traceback (most recent call last):
38    TypeError: f() takes exactly 2 positional arguments (1 given)
39    """
40    f(a)
41
42
43def failtype():
44    """
45    >>> failtype()
46    Traceback (most recent call last):
47    TypeError: an integer is required
48    """
49    h(42, "eggs")
50