diff options
author | gabrieldemarmiesse <gabriel.demarmiesse@teraki.com> | 2018-06-18 21:42:36 +0200 |
---|---|---|
committer | gabrieldemarmiesse <gabriel.demarmiesse@teraki.com> | 2018-06-18 21:42:36 +0200 |
commit | 9e55199c84a37a79f035604f3a11d879ebaca6fa (patch) | |
tree | 70ced8fb0435113d36f243230df8811ce33c00ca /docs/examples/tutorial/string | |
parent | 5c04c1a8ffd3a09c00cad41604bb648b786b8dda (diff) | |
download | cython-9e55199c84a37a79f035604f3a11d879ebaca6fa.tar.gz |
Moved an example from string.rst into the examples directory for testing.
Diffstat (limited to 'docs/examples/tutorial/string')
-rw-r--r-- | docs/examples/tutorial/string/return_memview.pyx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/examples/tutorial/string/return_memview.pyx b/docs/examples/tutorial/string/return_memview.pyx new file mode 100644 index 000000000..443e91636 --- /dev/null +++ b/docs/examples/tutorial/string/return_memview.pyx @@ -0,0 +1,7 @@ +def process_byte_data(unsigned char[:] data, bint return_all):
+ # ... process the data
+ if return_all:
+ return bytes(data)
+ else:
+ # example for returning a slice
+ return bytes(data[5:35])
|