summaryrefslogtreecommitdiff
path: root/docs/examples/tutorial/string/for_bytes.pyx
diff options
context:
space:
mode:
authorgabrieldemarmiesse <gabriel.demarmiesse@teraki.com>2018-06-21 15:12:33 +0200
committergabrieldemarmiesse <gabriel.demarmiesse@teraki.com>2018-06-21 15:12:33 +0200
commit3f5848fcaa7a2a495d83d2003ba02a8295f51b3f (patch)
tree8d1e55687d8e613b394cc8ace282e8c1d1d37a2a /docs/examples/tutorial/string/for_bytes.pyx
parent047809103580445f4dae65bb8c646dcd52231a10 (diff)
downloadcython-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.pyx6
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")