diff options
author | gabrieldemarmiesse <gabriel.demarmiesse@teraki.com> | 2018-06-21 15:12:33 +0200 |
---|---|---|
committer | gabrieldemarmiesse <gabriel.demarmiesse@teraki.com> | 2018-06-21 15:12:33 +0200 |
commit | 3f5848fcaa7a2a495d83d2003ba02a8295f51b3f (patch) | |
tree | 8d1e55687d8e613b394cc8ace282e8c1d1d37a2a /docs/examples/tutorial/string/for_bytes.pyx | |
parent | 047809103580445f4dae65bb8c646dcd52231a10 (diff) | |
download | cython-3f5848fcaa7a2a495d83d2003ba02a8295f51b3f.tar.gz |
Moved examples from string.rst and completed them to make them runnable.
Diffstat (limited to 'docs/examples/tutorial/string/for_bytes.pyx')
-rw-r--r-- | docs/examples/tutorial/string/for_bytes.pyx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/examples/tutorial/string/for_bytes.pyx b/docs/examples/tutorial/string/for_bytes.pyx new file mode 100644 index 000000000..1740ae236 --- /dev/null +++ b/docs/examples/tutorial/string/for_bytes.pyx @@ -0,0 +1,6 @@ +cdef bytes bytes_string = b'hello world'
+
+cdef char c
+for c in bytes_string:
+ if c == 'A':
+ print("Found the letter A")
|