44import asyncio
55import socket
66from dataclasses import dataclass
7- from typing import Any , Callable , Optional , Tuple , Type
7+ from typing import Any , Callable
88
99from pymodbus .client .mixin import ModbusClientMixin
1010from pymodbus .constants import Defaults
@@ -70,7 +70,7 @@ class _params: # pylint: disable=too-many-instance-attributes
7070
7171 host : str = None
7272 port : str | int = None
73- framer : Type [ModbusFramer ] = None
73+ framer : type [ModbusFramer ] = None
7474 timeout : float = None
7575 retries : int = None
7676 retry_on_empty : bool = None
@@ -80,15 +80,15 @@ class _params: # pylint: disable=too-many-instance-attributes
8080 kwargs : dict = None
8181 reconnect_delay : int = None
8282 reconnect_delay_max : int = None
83- on_reconnect_callback : Optional [ Callable [[], None ]] = None
83+ on_reconnect_callback : Callable [[], None ] | None = None
8484
8585 baudrate : int = None
8686 bytesize : int = None
8787 parity : str = None
8888 stopbits : int = None
8989 handle_local_echo : bool = None
9090
91- source_address : Tuple [str , int ] = None
91+ source_address : tuple [str , int ] = None
9292
9393 sslctx : str = None
9494 certfile : str = None
@@ -98,7 +98,7 @@ class _params: # pylint: disable=too-many-instance-attributes
9898
9999 def __init__ ( # pylint: disable=too-many-arguments
100100 self ,
101- framer : Type [ModbusFramer ] = None ,
101+ framer : type [ModbusFramer ] = None ,
102102 timeout : str | float = Defaults .Timeout ,
103103 retries : str | int = Defaults .Retries ,
104104 retry_on_empty : bool = Defaults .RetryOnEmpty ,
@@ -107,7 +107,7 @@ def __init__( # pylint: disable=too-many-arguments
107107 broadcast_enable : bool = Defaults .BroadcastEnable ,
108108 reconnect_delay : int = Defaults .ReconnectDelay ,
109109 reconnect_delay_max : int = Defaults .ReconnectDelayMax ,
110- on_reconnect_callback : Optional [ Callable [[], None ]] = None ,
110+ on_reconnect_callback : Callable [[], None ] | None = None ,
111111 ** kwargs : Any ,
112112 ) -> None :
113113 """Initialize a client instance."""
0 commit comments