From: Raymond Hettinger Date: Fri, 13 May 2011 08:38:31 +0000 (-0700) Subject: Further beautification of the example X-Git-Tag: v3.2.1rc1~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23157e5ddcbca17b1c83fefa058e66058de787c9;p=python Further beautification of the example --- diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 6df3106593..e10c794fd2 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1331,12 +1331,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)