def dict_constructor_with_sequence_copy(logical_line):
 MESSAGE = 'K008 Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs.'
 dict_constructor_with_sequence_re = re.compile('.*\\bdict\\((\\[)?(\\(|\\[)(?!\\{)')
 if dict_constructor_with_sequence_re.match(logical_line):
  (yield (0, MESSAGE))

def dict_constructor_with_sequence_copy ( logical_line ) : MESSAGE = 'K008 Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs.' dict_constructor_with_sequence_re = re . compile ( '.*\\bdict\\((\\[)?(\\(|\\[)(?!\\{)' ) if dict_constructor_with_sequence_re . match ( logical_line ) : ( yield ( 0 , MESSAGE ) )
should use a dict comprehension instead of a dict constructor .