@@ -333,7 +333,7 @@ def __gets(cls, identity, object_ids): # NOSONAR pylint: disable=unused-private
333333 :param object_ids: The specific object ids to read
334334 :returns: The requested data (id, length, value)
335335 """
336- return dict (( oid , identity [oid ]) for oid in object_ids if identity [oid ])
336+ return { oid : identity [oid ] for oid in object_ids if identity [oid ]}
337337
338338
339339# ---------------------------------------------------------------------------#
@@ -408,7 +408,7 @@ class ModbusCountersHandler:
408408 .. note:: I threw the event counter in here for convenience
409409 """
410410
411- __data = dict ([( i , 0x0000 ) for i in range (9 )]) # pylint: disable=consider-using-dict-comprehension
411+ __data = { i : 0x0000 for i in range (9 )} # pylint: disable=consider-using-dict-comprehension
412412 __names = [
413413 'BusMessage' ,
414414 'BusCommunicationError' ,
@@ -441,7 +441,7 @@ def update(self, values):
441441
442442 def reset (self ):
443443 """Clear all of the system counters."""
444- self .__data = dict ([( i , 0x0000 ) for i in range (9 )]) # pylint: disable=consider-using-dict-comprehension
444+ self .__data = { i : 0x0000 for i in range (9 )} # pylint: disable=consider-using-dict-comprehension
445445
446446 def summary (self ):
447447 """Return a summary of the counters current status.
@@ -564,7 +564,7 @@ def _setMode(self, mode): # pylint: disable=invalid-name
564564
565565 :param mode: The data transfer method in (RTU, ASCII)
566566 """
567- if mode in set ([ 'ASCII' , 'RTU' ]) :
567+ if mode in { 'ASCII' , 'RTU' } :
568568 self .__mode = mode # pylint: disable=unused-private-member
569569
570570 Mode = property (lambda s : s .__mode , _setMode )
0 commit comments