diff options
author | Matus Valo <matusvalo@users.noreply.github.com> | 2022-10-22 16:15:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-22 15:15:02 +0100 |
commit | b5b481132f6fa26c707504133b932e6bd0778c4f (patch) | |
tree | 7cd005aeb5fa97ab1c9dfaa71e97b1868e211979 /docs/examples/userguide/language_basics/function_pointer_struct.pyx | |
parent | 2e62a1560ac2241975534a8aaec4a3b4049591ba (diff) | |
download | cython-b5b481132f6fa26c707504133b932e6bd0778c4f.tar.gz |
[Docs] Refactor and extend structs, unions, enums, function pointer documentation in language basics userguide (#5082)
Diffstat (limited to 'docs/examples/userguide/language_basics/function_pointer_struct.pyx')
-rw-r--r-- | docs/examples/userguide/language_basics/function_pointer_struct.pyx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/examples/userguide/language_basics/function_pointer_struct.pyx b/docs/examples/userguide/language_basics/function_pointer_struct.pyx new file mode 100644 index 000000000..5ef618961 --- /dev/null +++ b/docs/examples/userguide/language_basics/function_pointer_struct.pyx @@ -0,0 +1,9 @@ +cdef struct Bar: + int sum(int a, int b) + +cdef int add(int a, int b): + return a + b + +cdef Bar bar = Bar(add) + +print(bar.sum(1, 2)) |