mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-18 14:29:47 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -3,10 +3,11 @@ from _typeshed import StrOrBytesPath
|
||||
from asyncio.events import AbstractEventLoop
|
||||
from os import stat_result
|
||||
from typing import Any, Sequence, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from . import ospath as path
|
||||
|
||||
_FdOrAnyPath = int | StrOrBytesPath
|
||||
_FdOrAnyPath: TypeAlias = int | StrOrBytesPath
|
||||
|
||||
async def stat(
|
||||
path: _FdOrAnyPath, # noqa: F811
|
||||
|
||||
@@ -8,14 +8,14 @@ from _typeshed import (
|
||||
)
|
||||
from asyncio import AbstractEventLoop
|
||||
from typing import Any, Callable, overload
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
from ..base import AiofilesContextManager
|
||||
from .binary import AsyncBufferedIOBase, AsyncBufferedReader, AsyncFileIO, _UnknownAsyncBinaryIO
|
||||
from .text import AsyncTextIOWrapper
|
||||
|
||||
_OpenFile = StrOrBytesPath | int
|
||||
_Opener = Callable[[str, int], int]
|
||||
_OpenFile: TypeAlias = StrOrBytesPath | int
|
||||
_Opener: TypeAlias = Callable[[str, int], int]
|
||||
|
||||
# Text mode: always returns AsyncTextIOWrapper
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user