Use TypeAlias where possible for type aliases (#7630)

This commit is contained in:
Alex Waygood authored and GitHub committed 2022-04-15 18:01:00 -07:00
1 parent c0e6dd3f3f
commit 740193a8fc
218 files changed
+760 -625

No files matched your search

+5 -4
View File
@@ -3,12 +3,13 @@ import sys
from builtins import type as Type # alias to avoid name clashes with property named "type"
from types import TracebackType
from typing import Any, BinaryIO, Iterable, NoReturn, overload
from typing_extensions import TypeAlias
# These are based in socket, maybe move them out into _typeshed.pyi or such
_Address = tuple[Any, ...] | str
_RetAddress = Any
_WriteBuffer = bytearray | memoryview
_CMSG = tuple[int, int, bytes]
_Address: TypeAlias = tuple[Any, ...] | str
_RetAddress: TypeAlias = Any
_WriteBuffer: TypeAlias = bytearray | memoryview
_CMSG: TypeAlias = tuple[int, int, bytes]
class TransportSocket:
def __init__(self, sock: socket.socket) -> None: ...