run lint with pyupgrade at py39-plus

This commit is contained in:
pacrob
2025-01-25 15:31:51 -07:00
committed by Paul Robinson
parent 20580b9a4e
commit 8787613e91
44 changed files with 221 additions and 240 deletions

View File

@ -2,10 +2,6 @@ from abc import (
ABC,
abstractmethod,
)
from typing import (
Dict,
Tuple,
)
from libp2p.typing import (
StreamHandlerFn,
@ -24,7 +20,7 @@ class IMultiselectMuxer(ABC):
communication.
"""
handlers: Dict[TProtocol, StreamHandlerFn]
handlers: dict[TProtocol, StreamHandlerFn]
@abstractmethod
def add_handler(self, protocol: TProtocol, handler: StreamHandlerFn) -> None:
@ -35,13 +31,13 @@ class IMultiselectMuxer(ABC):
:param handler: handler function
"""
def get_protocols(self) -> Tuple[TProtocol, ...]:
def get_protocols(self) -> tuple[TProtocol, ...]:
return tuple(self.handlers.keys())
@abstractmethod
async def negotiate(
self, communicator: IMultiselectCommunicator
) -> Tuple[TProtocol, StreamHandlerFn]:
) -> tuple[TProtocol, StreamHandlerFn]:
"""
Negotiate performs protocol selection.