Hopeful fix for fcntl stubs -- change return values back to Any.

This commit is contained in:
Guido van Rossum
2016-03-22 12:21:17 -07:00
parent 53e2d43f37
commit bf501353a0
2 changed files with 12 additions and 8 deletions

View File

@@ -77,18 +77,20 @@ LOCK_WRITE = ... # type: int
_AnyFile = Union[int, IO[Any]]
# TODO All these return either int or bytes depending on the value of
# cmd (not on the type of arg).
def fcntl(fd: _AnyFile,
cmd: int,
arg: Union[int, bytes] = ...) -> Union[int, bytes]: ...
arg: Union[int, bytes] = ...) -> Any: ...
# TODO This function accepts any object supporting a buffer interface,
# as arg, is there a better way to express this than bytes?
def ioctl(fd: _AnyFile,
request: int,
arg: Union[int, bytes] = ...,
mutate_flag: bool = ...) -> Union[int, bytes]: ...
mutate_flag: bool = ...) -> Any: ...
def flock(fd: _AnyFile, operation: int) -> None: ...
def lockf(fd: _AnyFile,
cmd: int,
len: int = ...,
start: int = ...,
whence: int = ...) -> Union[int, bytes]: ...
whence: int = ...) -> Any: ...