@@ -578,7 +578,7 @@ def set_data_route(self, route):
578578 raise ValueError ("Invalid route" )
579579
580580 def set_left_input (self , input ):
581- if not input in self ._input_config_table . keys () :
581+ if input not in self ._input_config_table :
582582 raise ValueError ("Invalid input" )
583583
584584 input = self ._input_config_table [input ]
@@ -595,7 +595,7 @@ def set_left_input(self, input):
595595 regs [_LINVOL ] = input [1 ]
596596
597597 def set_right_input (self , input ):
598- if not input in self ._input_config_table . keys () :
598+ if input not in self ._input_config_table :
599599 raise ValueError ("Invalid input name" )
600600
601601 input = self ._input_config_table [input ]
@@ -629,7 +629,7 @@ def config_data_format(self, sysclk, sample_rate, bits):
629629 self .regs [_IFACE1 ] = (_IFACE1_WL_MASK , wl << _IFACE1_WL_SHIFT )
630630
631631 def volume (self , module , volume_l = None , volume_r = None ):
632- if not module in self ._volume_config_table . keys () :
632+ if module not in self ._volume_config_table :
633633 raise ValueError ("Invalid module" )
634634
635635 if volume_l is None : # get volume
@@ -644,7 +644,7 @@ def volume(self, module, volume_l=None, volume_r=None):
644644
645645 if not ((0 <= volume_l <= 100 ) and (0 <= volume_r <= 100 )):
646646 raise ValueError ("Invalid value for volume" )
647- elif not module in self ._volume_config_table . keys () :
647+ elif module not in self ._volume_config_table :
648648 raise ValueError ("Invalid module" )
649649
650650 vol_max , regnum , flags = self ._volume_config_table [module ]
0 commit comments