From c6a726d061023abf0fdf7af41a3602b8f405d303 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 9 Apr 2011 13:00:17 -0700 Subject: [PATCH] Replace constant tuple with constant set. --- Lib/difflib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/difflib.py b/Lib/difflib.py index 003e72e2836..27c73d4e030 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':