Use PEP 604 syntax wherever possible (#7493)

This commit is contained in:
Alex Waygood
2022-03-16 15:01:33 +00:00
committed by GitHub
parent 15e21a8dc1
commit 3ab250eec8
174 changed files with 472 additions and 490 deletions
+2 -2
View File
@@ -2,11 +2,11 @@ import sys
from _typeshed import StrOrBytesPath
from asyncio.events import AbstractEventLoop
from os import stat_result
from typing import Any, Sequence, Union, overload
from typing import Any, Sequence, overload
from . import ospath as path
_FdOrAnyPath = Union[int, StrOrBytesPath]
_FdOrAnyPath = int | StrOrBytesPath
async def stat(
path: _FdOrAnyPath, # noqa: F811
@@ -7,14 +7,14 @@ from _typeshed import (
StrOrBytesPath,
)
from asyncio import AbstractEventLoop
from typing import Any, Callable, Union, overload
from typing import Any, Callable, overload
from typing_extensions import Literal
from ..base import AiofilesContextManager
from .binary import AsyncBufferedIOBase, AsyncBufferedReader, AsyncFileIO, _UnknownAsyncBinaryIO
from .text import AsyncTextIOWrapper
_OpenFile = Union[StrOrBytesPath, int]
_OpenFile = StrOrBytesPath | int
_Opener = Callable[[str, int], int]
# Text mode: always returns AsyncTextIOWrapper