Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,5 +1,5 @@
from _typeshed import FileDescriptorLike
from typing import Any, Union
from typing import Any
FASYNC: int
FD_CLOEXEC: int
@@ -74,9 +74,9 @@ LOCK_WRITE: int
# TODO All these return either int or bytes depending on the value of
# cmd (not on the type of arg).
def fcntl(fd: FileDescriptorLike, op: int, arg: Union[int, bytes] = ...) -> Any: ...
def fcntl(fd: FileDescriptorLike, op: int, arg: int | bytes = ...) -> Any: ...
# TODO: arg: int or read-only buffer interface or read-write buffer interface
def ioctl(fd: FileDescriptorLike, op: int, arg: Union[int, bytes] = ..., mutate_flag: bool = ...) -> Any: ...
def ioctl(fd: FileDescriptorLike, op: int, arg: int | bytes = ..., mutate_flag: bool = ...) -> Any: ...
def flock(fd: FileDescriptorLike, op: int) -> None: ...
def lockf(fd: FileDescriptorLike, op: int, length: int = ..., start: int = ..., whence: int = ...) -> Any: ...