summaryrefslogtreecommitdiffstats
path: root/Lib/tokenize.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-18 18:24:07 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-18 18:24:07 (GMT)
commit288e89acfc29cf857a8c5d314ba2dd3398a2eae9 (patch)
treee4ca8e317d378207d274157a0dc138e2917cbc1b /Lib/tokenize.py
parenta9e073d100c3869231ce7275ff7a810d8db74fc4 (diff)
downloadcpython-288e89acfc29cf857a8c5d314ba2dd3398a2eae9.zip
cpython-288e89acfc29cf857a8c5d314ba2dd3398a2eae9.tar.gz
cpython-288e89acfc29cf857a8c5d314ba2dd3398a2eae9.tar.bz2
Added bytes and b'' as aliases for str and ''
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r--Lib/tokenize.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index 5a9d08c..9322e0f 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -109,21 +109,34 @@ endprogs = {"'": re.compile(Single), '"': re.compile(Double),
"uR'''": single3prog, 'uR"""': double3prog,
"Ur'''": single3prog, 'Ur"""': double3prog,
"UR'''": single3prog, 'UR"""': double3prog,
- 'r': None, 'R': None, 'u': None, 'U': None}
+ "b'''": single3prog, 'b"""': double3prog,
+ "br'''": single3prog, 'br"""': double3prog,
+ "B'''": single3prog, 'B"""': double3prog,
+ "bR'''": single3prog, 'bR"""': double3prog,
+ "Br'''": single3prog, 'Br"""': double3prog,
+ "BR'''": single3prog, 'BR"""': double3prog,
+ 'r': None, 'R': None, 'u': None, 'U': None,
+ 'b': None, 'B': None}
triple_quoted = {}
for t in ("'''", '"""',
"r'''", 'r"""', "R'''", 'R"""',
"u'''", 'u"""', "U'''", 'U"""',
"ur'''", 'ur"""', "Ur'''", 'Ur"""',
- "uR'''", 'uR"""', "UR'''", 'UR"""'):
+ "uR'''", 'uR"""', "UR'''", 'UR"""',
+ "b'''", 'b"""', "B'''", 'B"""',
+ "br'''", 'br"""', "Br'''", 'Br"""',
+ "bR'''", 'bR"""', "BR'''", 'BR"""'):
triple_quoted[t] = t
single_quoted = {}
for t in ("'", '"',
"r'", 'r"', "R'", 'R"',
"u'", 'u"', "U'", 'U"',
"ur'", 'ur"', "Ur'", 'Ur"',
- "uR'", 'uR"', "UR'", 'UR"' ):
+ "uR'", 'uR"', "UR'", 'UR"',
+ "b'", 'b"', "B'", 'B"',
+ "br'", 'br"', "Br'", 'Br"',
+ "bR'", 'bR"', "BR'", 'BR"' ):
single_quoted[t] = t
tabsize = 8