@@ -290,7 +290,7 @@ def convert_value(value):
290290 except ValueError :
291291 return value
292292
293- info = ObjectView (dict (map ( lambda f_v : ( convert_field (f_v [0 ]), convert_value (f_v [1 ])), zip (fields , values ) )))
293+ info = ObjectView (dict (( convert_field (f_v [0 ]), convert_value (f_v [1 ])) for f_v in zip (fields , values )))
294294
295295 try :
296296 count_map = info .countMap
@@ -299,15 +299,15 @@ def convert_value(value):
299299 else :
300300 count_map = count_map .split (';' )
301301 n = len (count_map )
302- info .countMap = dict (zip (islice (count_map , 0 , n , 2 ), islice (count_map , 1 , n , 2 )))
302+ info .countMap = dict (list ( zip (islice (count_map , 0 , n , 2 ), islice (count_map , 1 , n , 2 ) )))
303303
304304 try :
305305 msg_type = info .msgType
306306 msg_text = info .msg
307307 except AttributeError :
308308 pass
309309 else :
310- messages = filter ( lambda t_m : t_m [ 0 ] or t_m [ 1 ], zip (msg_type .split ('\n ' ), msg_text .split ('\n ' )))
310+ messages = [ t_m for t_m in zip (msg_type .split ('\n ' ), msg_text .split ('\n ' )) if t_m [ 0 ] or t_m [ 1 ]]
311311 info .msg = [Message (message ) for message in messages ]
312312 del info .msgType
313313
@@ -449,7 +449,7 @@ def _map_metadata(self, argv):
449449 def _map (metadata_map ):
450450 metadata = {}
451451
452- for name , value in metadata_map .items ():
452+ for name , value in list ( metadata_map .items () ):
453453 if isinstance (value , dict ):
454454 value = _map (value )
455455 else :
@@ -587,7 +587,8 @@ def _process_protocol_v1(self, argv, ifile, ofile):
587587
588588 ifile = self ._prepare_protocol_v1 (argv , ifile , ofile )
589589 self ._record_writer .write_record (dict (
590- (n , ',' .join (v ) if isinstance (v , (list , tuple )) else v ) for n , v in self ._configuration .items ()))
590+ (n , ',' .join (v ) if isinstance (v , (list , tuple )) else v ) for n , v in
591+ list (self ._configuration .items ())))
591592 self .finish ()
592593
593594 elif argv [1 ] == '__EXECUTE__' :
@@ -937,7 +938,7 @@ def _read_csv_records(self, ifile):
937938
938939 if len (mv_fieldnames ) == 0 :
939940 for values in reader :
940- yield OrderedDict (zip (fieldnames , values ))
941+ yield OrderedDict (list ( zip (fieldnames , values ) ))
941942 return
942943
943944 for values in reader :
@@ -1019,8 +1020,8 @@ def __repr__(self):
10191020
10201021 """
10211022 definitions = type (self ).configuration_setting_definitions
1022- settings = map (
1023- lambda setting : repr (( setting . name , setting . __get__ ( self ), setting . supporting_protocols )), definitions )
1023+ settings = [ repr (( setting . name , setting . __get__ ( self ), setting . supporting_protocols )) for setting in
1024+ definitions ]
10241025 return '[' + ', ' .join (settings ) + ']'
10251026
10261027 def __str__ (self ):
@@ -1033,7 +1034,7 @@ def __str__(self):
10331034
10341035 """
10351036 # text = ', '.join(imap(lambda (name, value): name + '=' + json_encode_string(unicode(value)), self.iteritems()))
1036- text = ', ' .join ([f'{ name } ={ json_encode_string (str (value ))} ' for (name , value ) in self .items ()])
1037+ text = ', ' .join ([f'{ name } ={ json_encode_string (str (value ))} ' for (name , value ) in list ( self .items () )])
10371038 return text
10381039
10391040 # region Methods
@@ -1057,10 +1058,10 @@ def fix_up(cls, command_class):
10571058 def iteritems (self ):
10581059 definitions = type (self ).configuration_setting_definitions
10591060 version = self .command .protocol_version
1060- return filter (
1061- lambda name_value1 : name_value1 [ 1 ] is not None , map (
1062- lambda setting : ( setting . name , setting .__get__ ( self )), filter (
1063- lambda setting : setting . is_supported_by_protocol ( version ), definitions )))
1061+ return [ name_value1 for name_value1 in [( setting . name , setting . __get__ ( self )) for setting in
1062+ [ setting for setting in definitions if
1063+ setting .is_supported_by_protocol ( version )]] if
1064+ name_value1 [ 1 ] is not None ]
10641065
10651066 # N.B.: Does not use Python 3 dict view semantics
10661067
0 commit comments