summaryrefslogtreecommitdiff
path: root/docs/examples/userguide/sharing_declarations/restaurant.pyx
blob: 3257c681b4bf7785cecd30d76b25b2af63cc2996 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
from __future__ import print_function
cimport dishes
from dishes cimport spamdish

cdef void prepare(spamdish *d):
    d.oz_of_spam = 42
    d.filler = dishes.sausage

def serve():
    cdef spamdish d
    prepare(&d)
    print(f'{d.oz_of_spam} oz spam, filler no. {d.filler}')