[Python-checkins] cpython: Replace constant tuple with constant set.
raymond.hettinger
python-checkins at python.org
Sat Apr 9 22:00:25 CEST 2011
http://hg.python.org/cpython/rev/a1235865dd54
changeset: 69223:a1235865dd54
user: Raymond Hettinger <python at rcn.com>
date: Sat Apr 09 13:00:17 2011 -0700
summary:
Replace constant tuple with constant set.
files:
Lib/difflib.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/difflib.py b/Lib/difflib.py
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -1267,7 +1267,7 @@
yield '*** %d,%d ****%s' % (group[0][1]+1, group[-1][2], lineterm)
else:
yield '*** %d ****%s' % (group[-1][2], lineterm)
- visiblechanges = [e for e in group if e[0] in ('replace', 'delete')]
+ visiblechanges = [e for e in group if e[0] in {'replace', 'delete'}]
if visiblechanges:
for tag, i1, i2, _, _ in group:
if tag != 'insert':
@@ -1278,7 +1278,7 @@
yield '--- %d,%d ----%s' % (group[0][3]+1, group[-1][4], lineterm)
else:
yield '--- %d ----%s' % (group[-1][4], lineterm)
- visiblechanges = [e for e in group if e[0] in ('replace', 'insert')]
+ visiblechanges = [e for e in group if e[0] in {'replace', 'insert'}]
if visiblechanges:
for tag, _, _, j1, j2 in group:
if tag != 'delete':
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list