summaryrefslogtreecommitdiff
path: root/tests/run/cpdef_void_return.pyx
blob: 7943c3466280d8501b63274f79112478a5bb6f81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cpdef void unraisable() noexcept:
    """
    >>> unraisable()
    here
    """
    print('here')
    raise RuntimeError()

cpdef void raisable() except *:
    """
    >>> raisable()
    Traceback (most recent call last):
    ...
    RuntimeError
    """
    print('here')
    raise RuntimeError()

cdef class A:
    """
    >>> A().foo()
    A
    """
    cpdef void foo(self):
        print "A"

cdef class B(A):
    """
    >>> B().foo()
    B
    """
    cpdef void foo(self):
        print "B"

class C(B):
    """
    >>> C().foo()
    C
    """
    def foo(self):
        print "C"