summaryrefslogtreecommitdiff
path: root/tests/run/pyextattrref.pyx
blob: 7b9b9e564b6c90ad53d82bf029ee1adba018fcd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
__doc__ = u"""
    >>> s = Spam(Eggs("ham"))
    >>> test(s)
    'ham'
"""

cdef class Eggs:
    cdef object ham
    def __init__(self, ham):
        self.ham = ham

cdef class Spam:
    cdef Eggs eggs
    def __init__(self, eggs):
        self.eggs = eggs

cdef object tomato(Spam s):
    food = s.eggs.ham
    return food

def test(Spam s):
    return tomato(s)