From: Raymond Hettinger Date: Sat, 9 Apr 2011 20:00:17 +0000 (-0700) Subject: Replace constant tuple with constant set. X-Git-Tag: v3.3.0a1~2635 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c6a726d061023abf0fdf7af41a3602b8f405d303;p=thirdparty%2FPython%2Fcpython.git Replace constant tuple with constant set. --- diff --git a/Lib/difflib.py b/Lib/difflib.py index 003e72e28363..27c73d4e0305 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -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':