summaryrefslogtreecommitdiff
path: root/docs/examples/userguide/sharing_declarations/restaurant.py
blob: b4bdb2eba664a5ce52da815ad8e359d577fe0428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import cython
from cython.cimports.dishes import spamdish, sausage

@cython.cfunc
def prepare(d: cython.pointer(spamdish)) -> cython.void:
    d.oz_of_spam = 42
    d.filler = sausage

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