mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-11 07:30:55 +00:00
run lint with pyupgrade at py39-plus
This commit is contained in:
@ -2,9 +2,6 @@ from abc import (
|
||||
ABC,
|
||||
abstractmethod,
|
||||
)
|
||||
from typing import (
|
||||
Tuple,
|
||||
)
|
||||
|
||||
from multiaddr import (
|
||||
Multiaddr,
|
||||
@ -23,7 +20,7 @@ class IListener(ABC):
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_addrs(self) -> Tuple[Multiaddr, ...]:
|
||||
def get_addrs(self) -> tuple[Multiaddr, ...]:
|
||||
"""
|
||||
Retrieve list of addresses the listener is listening on.
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
from collections.abc import (
|
||||
Awaitable,
|
||||
Sequence,
|
||||
)
|
||||
import logging
|
||||
from typing import (
|
||||
Awaitable,
|
||||
Callable,
|
||||
List,
|
||||
Sequence,
|
||||
Tuple,
|
||||
)
|
||||
|
||||
from multiaddr import (
|
||||
@ -41,7 +41,7 @@ logger = logging.getLogger("libp2p.transport.tcp")
|
||||
|
||||
|
||||
class TCPListener(IListener):
|
||||
listeners: List[trio.SocketListener]
|
||||
listeners: list[trio.SocketListener]
|
||||
|
||||
def __init__(self, handler_function: THandler) -> None:
|
||||
self.listeners = []
|
||||
@ -78,7 +78,7 @@ class TCPListener(IListener):
|
||||
)
|
||||
self.listeners.extend(listeners)
|
||||
|
||||
def get_addrs(self) -> Tuple[Multiaddr, ...]:
|
||||
def get_addrs(self) -> tuple[Multiaddr, ...]:
|
||||
"""
|
||||
Retrieve list of addresses the listener is listening on.
|
||||
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
from typing import (
|
||||
from collections.abc import (
|
||||
Awaitable,
|
||||
Callable,
|
||||
Mapping,
|
||||
Type,
|
||||
)
|
||||
from typing import (
|
||||
Callable,
|
||||
)
|
||||
|
||||
from libp2p.io.abc import (
|
||||
@ -20,5 +21,5 @@ from libp2p.typing import (
|
||||
|
||||
THandler = Callable[[ReadWriteCloser], Awaitable[None]]
|
||||
TSecurityOptions = Mapping[TProtocol, ISecureTransport]
|
||||
TMuxerClass = Type[IMuxedConn]
|
||||
TMuxerClass = type[IMuxedConn]
|
||||
TMuxerOptions = Mapping[TProtocol, TMuxerClass]
|
||||
|
||||
Reference in New Issue
Block a user