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

@ -1,10 +1,11 @@
from abc import (
abstractmethod,
)
from collections.abc import (
Sequence,
)
from typing import (
Any,
List,
Sequence,
)
from multiaddr import (
@ -40,7 +41,7 @@ class IPeerStore(IAddrBook, IPeerMetadata):
"""
@abstractmethod
def get_protocols(self, peer_id: ID) -> List[str]:
def get_protocols(self, peer_id: ID) -> list[str]:
"""
:param peer_id: peer ID to get protocols for
:return: protocols (as list of strings)
@ -62,7 +63,7 @@ class IPeerStore(IAddrBook, IPeerMetadata):
"""
@abstractmethod
def peer_ids(self) -> List[ID]:
def peer_ids(self) -> list[ID]:
"""
:return: all of the peer IDs stored in peer store
"""
@ -101,7 +102,7 @@ class IPeerStore(IAddrBook, IPeerMetadata):
"""
@abstractmethod
def addrs(self, peer_id: ID) -> List[Multiaddr]:
def addrs(self, peer_id: ID) -> list[Multiaddr]:
"""
:param peer_id: peer ID to get addrs for
:return: list of addrs
@ -114,7 +115,7 @@ class IPeerStore(IAddrBook, IPeerMetadata):
"""
@abstractmethod
def peers_with_addrs(self) -> List[ID]:
def peers_with_addrs(self) -> list[ID]:
"""
:return: all of the peer IDs which has addrs stored in peer store
"""