Skip to content

Commit 760db7c

Browse files
Apply ruff/pyupgrade rule UP006
UP006 Use `dict` instead of `Dict` for type annotation UP006 Use `list` instead of `List` for type annotation
1 parent 1f26389 commit 760db7c

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

uvloop/loop.pyi

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@ from typing import (
66
Any,
77
Awaitable,
88
Callable,
9-
Dict,
109
Generator,
11-
List,
1210
Optional,
1311
Sequence,
14-
Tuple,
1512
TypeVar,
1613
Union,
1714
overload,
1815
)
1916

2017
_T = TypeVar('_T')
21-
_Context = Dict[str, Any]
18+
_Context = dict[str, Any]
2219
_ExceptionHandler = Callable[[asyncio.AbstractEventLoop, _Context], Any]
2320
_SSLContext = Union[bool, None, ssl.SSLContext]
2421
_ProtocolT = TypeVar("_ProtocolT", bound=asyncio.BaseProtocol)
@@ -75,24 +72,24 @@ class Loop:
7572
type: int = ...,
7673
proto: int = ...,
7774
flags: int = ...,
78-
) -> List[
79-
Tuple[
75+
) -> list[
76+
tuple[
8077
AddressFamily,
8178
SocketKind,
8279
int,
8380
str,
84-
Union[Tuple[str, int], Tuple[str, int, int, int]],
81+
Union[tuple[str, int], tuple[str, int, int, int]],
8582
]
8683
]: ...
8784
async def getnameinfo(
8885
self,
8986
sockaddr: Union[
90-
Tuple[str, int],
91-
Tuple[str, int, int],
92-
Tuple[str, int, int, int]
87+
tuple[str, int],
88+
tuple[str, int, int],
89+
tuple[str, int, int, int]
9390
],
9491
flags: int = ...,
95-
) -> Tuple[str, str]: ...
92+
) -> tuple[str, str]: ...
9693
async def start_tls(
9794
self,
9895
transport: asyncio.BaseTransport,
@@ -152,7 +149,7 @@ class Loop:
152149
proto: int = ...,
153150
flags: int = ...,
154151
sock: None = ...,
155-
local_addr: Optional[Tuple[str, int]] = ...,
152+
local_addr: Optional[tuple[str, int]] = ...,
156153
server_hostname: Optional[str] = ...,
157154
ssl_handshake_timeout: Optional[float] = ...,
158155
ssl_shutdown_timeout: Optional[float] = ...,
@@ -208,7 +205,7 @@ class Loop:
208205
async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ...
209206
async def sock_recv_into(self, sock: socket, buf: bytearray) -> int: ...
210207
async def sock_sendall(self, sock: socket, data: bytes) -> None: ...
211-
async def sock_accept(self, sock: socket) -> Tuple[socket, _RetAddress]: ...
208+
async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ...
212209
async def sock_connect(self, sock: socket, address: _Address) -> None: ...
213210
async def sock_recvfrom(self, sock: socket, bufsize: int) -> bytes: ...
214211
async def sock_recvfrom_into(self, sock: socket, buf: bytearray, nbytes: int = ...) -> int: ...
@@ -258,8 +255,8 @@ class Loop:
258255
async def create_datagram_endpoint(
259256
self,
260257
protocol_factory: Callable[[], _ProtocolT],
261-
local_addr: Optional[Tuple[str, int]] = ...,
262-
remote_addr: Optional[Tuple[str, int]] = ...,
258+
local_addr: Optional[tuple[str, int]] = ...,
259+
remote_addr: Optional[tuple[str, int]] = ...,
263260
*,
264261
family: int = ...,
265262
proto: int = ...,

0 commit comments

Comments
 (0)