@@ -177,14 +177,12 @@ async def _read(self, start_entry: int, number_entries: int) -> List[int]:
177177 read_callback = self ._callbacks .read_callback
178178
179179 if read_block_callback is not None :
180- # python 3.7 doesn't have the callback defined as protocol so mypy doesn't recognise
181- # the arguments in the call back functions
182180 addr = self .address_lookup (entry = start_entry )
183181 data_read = \
184- await read_block_callback (addr = addr , # type: ignore[call-arg]
185- width = self .width , # type: ignore[call-arg]
186- accesswidth = self .width , # type: ignore[call-arg]
187- length = number_entries ) # type: ignore[call-arg]
182+ await read_block_callback (addr = addr ,
183+ width = self .width ,
184+ accesswidth = self .width ,
185+ length = number_entries )
188186
189187 if isinstance (self ._callbacks , AsyncCallbackSet ):
190188 if not isinstance (data_read , List ):
@@ -204,11 +202,10 @@ async def _read(self, start_entry: int, number_entries: int) -> List[int]:
204202
205203 for entry in range (number_entries ):
206204 entry_address = self .address_lookup (entry = start_entry + entry )
207- # python 3.7 doesn't have the callback defined as protocol so mypy doesn't
208- # recognise the arguments in the call back functions
209- data_entry = await read_callback (addr = entry_address , # type: ignore[call-arg]
210- width = self .width , # type: ignore[call-arg]
211- accesswidth = self .width ) # type: ignore[call-arg]
205+
206+ data_entry = await read_callback (addr = entry_address ,
207+ width = self .width ,
208+ accesswidth = self .width )
212209
213210 data_read [entry ] = data_entry
214211
@@ -248,14 +245,12 @@ async def _read_legacy(self, start_entry: int, number_entries: int) -> Array:
248245 read_callback = self ._callbacks .read_callback
249246
250247 if read_block_callback is not None :
251- # python 3.7 doesn't have the callback defined as protocol so mypy doesn't recognise
252- # the arguments in the call back functions
253248 addr = self .address_lookup (entry = start_entry )
254249 data_read = \
255- await read_block_callback (addr = addr , # type: ignore[call-arg]
256- width = self .width , # type: ignore[call-arg]
257- accesswidth = self .width , # type: ignore[call-arg]
258- length = number_entries ) # type: ignore[call-arg]
250+ await read_block_callback (addr = addr ,
251+ width = self .width ,
252+ accesswidth = self .width ,
253+ length = number_entries )
259254
260255 if isinstance (self ._callbacks , AsyncCallbackSet ):
261256 if not isinstance (data_read , List ):
@@ -275,11 +270,9 @@ async def _read_legacy(self, start_entry: int, number_entries: int) -> Array:
275270
276271 for entry in range (number_entries ):
277272 entry_address = self .address_lookup (entry = start_entry + entry )
278- # python 3.7 doesn't have the callback defined as protocol so mypy doesn't
279- # recognise the arguments in the call back functions
280- data_entry = await read_callback (addr = entry_address , # type: ignore[call-arg]
281- width = self .width , # type: ignore[call-arg]
282- accesswidth = self .width ) # type: ignore[call-arg]
273+ data_entry = await read_callback (addr = entry_address ,
274+ width = self .width ,
275+ accesswidth = self .width )
283276
284277 data_read_block [entry ] = data_entry
285278
@@ -428,53 +421,41 @@ async def _write(self, start_entry: int, data: Union[Array, List[int]]) -> None:
428421 f'but got { len (data ):d} ' )
429422
430423 if self ._callbacks .write_block_callback is not None :
431- # python 3.7 doesn't have the callback defined as protocol so mypy doesn't recognise
432- # the arguments in the call back functions
424+
433425 addr = self .address_lookup (entry = start_entry )
434426 if isinstance (self ._callbacks , AsyncCallbackSet ):
435427 if isinstance (data , Array ):
436- # pylint: disable=line-too-long
437- await self ._callbacks .write_block_callback (addr = addr , # type: ignore[call-arg]
438- width = self .width , # type: ignore[call-arg]
439- accesswidth = self .width , # type: ignore[call-arg]
440- data = data .tolist ()) # type: ignore[call-arg]
441- # pylint: enable=line-too-long
428+ await self ._callbacks .write_block_callback (addr = addr ,
429+ width = self .width ,
430+ accesswidth = self .width ,
431+ data = data .tolist ())
442432 else :
443- # pylint: disable=line-too-long
444- await self ._callbacks .write_block_callback (addr = addr , # type: ignore[call-arg]
445- width = self .width , # type: ignore[call-arg]
446- accesswidth = self .width , # type: ignore[call-arg]
447- data = data ) # type: ignore[call-arg]
448- # pylint: enable=line-too-long
433+ await self ._callbacks .write_block_callback (addr = addr ,
434+ width = self .width ,
435+ accesswidth = self .width ,
436+ data = data )
449437 if isinstance (self ._callbacks , AsyncCallbackSetLegacy ):
450438 if isinstance (data , list ):
451439 # need to convert the data to an array before calling
452- # pylint: disable=line-too-long
453- await self ._callbacks .write_block_callback (addr = addr , # type: ignore[call-arg]
454- width = self .width , # type: ignore[call-arg]
455- accesswidth = self .width , # type: ignore[call-arg]
456- data = Array (self .array_typecode , data )) # type: ignore[call-arg]
457- # pylint: enable=line-too-long
440+ await self ._callbacks .write_block_callback (
441+ addr = addr ,
442+ width = self .width ,
443+ accesswidth = self .width ,
444+ data = Array (self .array_typecode , data ))
458445 else :
459- # pylint: disable=line-too-long
460- await self ._callbacks .write_block_callback (addr = addr , # type: ignore[call-arg]
461- width = self .width , # type: ignore[call-arg]
462- accesswidth = self .width , # type: ignore[call-arg]
463- data = data ) # type: ignore[call-arg]
464- # pylint: enable=line-too-long
446+ await self ._callbacks .write_block_callback (addr = addr ,
447+ width = self .width ,
448+ accesswidth = self .width ,
449+ data = data )
465450
466451 elif self ._callbacks .write_callback is not None :
467452 # there is not write_block_callback defined so we must used individual write
468453 for entry_index , entry_data in enumerate (data ):
469454 entry_address = self .address_lookup (entry = start_entry + entry_index )
470- # python 3.7 doesn't have the callback defined as protocol so mypy doesn't
471- # recognise the arguments in the call back functions
472- # pylint: disable=line-too-long
473- await self ._callbacks .write_callback (addr = entry_address , # type: ignore[call-arg]
474- width = self .width , # type: ignore[call-arg]
475- accesswidth = self .width , # type: ignore[call-arg]
476- data = entry_data ) # type: ignore[call-arg]
477- # pylint: enable=line-too-long
455+ await self ._callbacks .write_callback (addr = entry_address ,
456+ width = self .width ,
457+ accesswidth = self .width ,
458+ data = entry_data )
478459
479460 else :
480461 raise RuntimeError ('No suitable callback' )
0 commit comments