summaryrefslogtreecommitdiffstats
path: root/Doc/library/re.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2011-05-13 08:39:22 (GMT)
committerRaymond Hettinger <python@rcn.com>2011-05-13 08:39:22 (GMT)
commitdb3dd8a6cccc613addba0df7b4cd7145e903c27e (patch)
tree76a2fb70310840dfbe9b465949e794b50b64896d /Doc/library/re.rst
parent2584b2f9f3184894713d71ff57938bbb5eaf8bde (diff)
parent23157e5ddcbca17b1c83fefa058e66058de787c9 (diff)
downloadcpython-db3dd8a6cccc613addba0df7b4cd7145e903c27e.zip
cpython-db3dd8a6cccc613addba0df7b4cd7145e903c27e.tar.gz
cpython-db3dd8a6cccc613addba0df7b4cd7145e903c27e.tar.bz2
Further beautification of the example
Diffstat (limited to 'Doc/library/re.rst')
-rw-r--r--Doc/library/re.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index a753c68..84f3118 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -1334,12 +1334,15 @@ successive matches::
if pos != len(s):
raise RuntimeError('Unexpected character %r on line %d' %(s[pos], line))
- >>> statements = '''\
+ statements = '''\
total := total + price * quantity;
tax := price * 0.05;
'''
- >>> for token in tokenize(statements):
- print(token)
+
+ for token in tokenize(statements):
+ print(token)
+
+The tokenizer produces the following output::
Token(typ='ID', value='total', line=1, column=8)
Token(typ='ASSIGN', value=':=', line=1, column=14)