]> granicus.if.org Git - python/commitdiff
Replace constant tuple with constant set.
authorRaymond Hettinger <python@rcn.com>
Sat, 9 Apr 2011 20:00:17 +0000 (13:00 -0700)
committerRaymond Hettinger <python@rcn.com>
Sat, 9 Apr 2011 20:00:17 +0000 (13:00 -0700)
Lib/difflib.py

index 003e72e283639f82691c92be2f3993ed9f122676..27c73d4e03059c028fb1302a0786698cc05166a1 100644 (file)
@@ -1267,7 +1267,7 @@ def context_diff(a, b, fromfile='', tofile='',
             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 @@ def context_diff(a, b, fromfile='', tofile='',
             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':