Fixed #23968 -- Replaced list comprehension with generators and dict comprehension

This commit is contained in:
Jon Dufresne 2014-12-06 13:00:09 -08:00 committed by Tim Graham
parent b327a614eb
commit 4468c08d70
65 changed files with 169 additions and 169 deletions

View file

@ -145,8 +145,8 @@ def colorize(text='', opts=(), **kwargs):
print('this should not be red')
"""
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = dict([(color_names[x], '3%s' % x) for x in range(8)])
background = dict([(color_names[x], '4%s' % x) for x in range(8)])
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'reverse': '7', 'conceal': '8'}