@@ -286,12 +286,7 @@ def translate_from_rpc(rpcSettingOptions):
286286 rpcSettingOptions .component_id ,
287287 rpcSettingOptions .setting_id ,
288288 rpcSettingOptions .setting_description ,
289- list (
290- map (
291- lambda elem : Option .translate_from_rpc (elem ),
292- rpcSettingOptions .options ,
293- )
294- ),
289+ [Option .translate_from_rpc (elem ) for elem in rpcSettingOptions .options ],
295290 rpcSettingOptions .is_range ,
296291 )
297292
@@ -1088,12 +1083,10 @@ def translate_from_rpc(rpcCurrentSettingsUpdate):
10881083 """Translates a gRPC struct to the SDK equivalent"""
10891084 return CurrentSettingsUpdate (
10901085 rpcCurrentSettingsUpdate .component_id ,
1091- list (
1092- map (
1093- lambda elem : Setting .translate_from_rpc (elem ),
1094- rpcCurrentSettingsUpdate .current_settings ,
1095- )
1096- ),
1086+ [
1087+ Setting .translate_from_rpc (elem )
1088+ for elem in rpcCurrentSettingsUpdate .current_settings
1089+ ],
10971090 )
10981091
10991092 def translate_to_rpc (self , rpcCurrentSettingsUpdate ):
@@ -1157,12 +1150,10 @@ def translate_from_rpc(rpcPossibleSettingOptionsUpdate):
11571150 """Translates a gRPC struct to the SDK equivalent"""
11581151 return PossibleSettingOptionsUpdate (
11591152 rpcPossibleSettingOptionsUpdate .component_id ,
1160- list (
1161- map (
1162- lambda elem : SettingOptions .translate_from_rpc (elem ),
1163- rpcPossibleSettingOptionsUpdate .setting_options ,
1164- )
1165- ),
1153+ [
1154+ SettingOptions .translate_from_rpc (elem )
1155+ for elem in rpcPossibleSettingOptionsUpdate .setting_options
1156+ ],
11661157 )
11671158
11681159 def translate_to_rpc (self , rpcPossibleSettingOptionsUpdate ):
@@ -1873,12 +1864,7 @@ def __str__(self):
18731864 def translate_from_rpc (rpcCameraList ):
18741865 """Translates a gRPC struct to the SDK equivalent"""
18751866 return CameraList (
1876- list (
1877- map (
1878- lambda elem : Information .translate_from_rpc (elem ),
1879- rpcCameraList .cameras ,
1880- )
1881- )
1867+ [Information .translate_from_rpc (elem ) for elem in rpcCameraList .cameras ]
18821868 )
18831869
18841870 def translate_to_rpc (self , rpcCameraList ):
@@ -2183,11 +2169,7 @@ async def list_photos(self, component_id, photos_range):
21832169 if result .result != CameraResult .Result .SUCCESS :
21842170 raise CameraError (result , "list_photos()" , component_id , photos_range )
21852171
2186- capture_infos = []
2187- for capture_infos_rpc in response .capture_infos :
2188- capture_infos .append (CaptureInfo .translate_from_rpc (capture_infos_rpc ))
2189-
2190- return capture_infos
2172+ return [CaptureInfo .translate_from_rpc (elem ) for elem in response .capture_infos ]
21912173
21922174 async def camera_list (self ):
21932175 """
@@ -2448,11 +2430,7 @@ async def get_current_settings(self, component_id):
24482430 if result .result != CameraResult .Result .SUCCESS :
24492431 raise CameraError (result , "get_current_settings()" , component_id )
24502432
2451- current_settings = []
2452- for current_settings_rpc in response .current_settings :
2453- current_settings .append (Setting .translate_from_rpc (current_settings_rpc ))
2454-
2455- return current_settings
2433+ return [Setting .translate_from_rpc (elem ) for elem in response .current_settings ]
24562434
24572435 async def possible_setting_options (self ):
24582436 """
@@ -2508,13 +2486,9 @@ async def get_possible_setting_options(self, component_id):
25082486 if result .result != CameraResult .Result .SUCCESS :
25092487 raise CameraError (result , "get_possible_setting_options()" , component_id )
25102488
2511- setting_options = []
2512- for setting_options_rpc in response .setting_options :
2513- setting_options .append (
2514- SettingOptions .translate_from_rpc (setting_options_rpc )
2515- )
2516-
2517- return setting_options
2489+ return [
2490+ SettingOptions .translate_from_rpc (elem ) for elem in response .setting_options
2491+ ]
25182492
25192493 async def set_setting (self , component_id , setting ):
25202494 """
0 commit comments