diff options
Diffstat (limited to 'docs/examples/userguide/fusedtypes/pointer.py')
-rw-r--r-- | docs/examples/userguide/fusedtypes/pointer.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/examples/userguide/fusedtypes/pointer.py b/docs/examples/userguide/fusedtypes/pointer.py new file mode 100644 index 000000000..043074c79 --- /dev/null +++ b/docs/examples/userguide/fusedtypes/pointer.py @@ -0,0 +1,13 @@ +my_fused_type = cython.fused_type(cython.int, cython.float) + + +@cython.cfunc +def func(a: cython.pointer(my_fused_type)): + print(a[0]) + +def main(): + a: cython.int = 3 + b: cython.float = 5.0 + + func(cython.address(a)) + func(cython.address(b)) |