Corrects timeout type annotations. (#1639)

Timeouts should be floats, but were ints for some reason.
This commit is contained in:
hashstat
2017-10-04 08:40:40 -07:00
committed by Jelle Zijlstra
parent 15f737d2a8
commit fc74f53c5a

View File

@@ -35,7 +35,7 @@ def setprofile(func: _PF) -> None: ...
def stack_size(size: int = ...) -> int: ...
if sys.version_info >= (3,):
TIMEOUT_MAX = ... # type: int
TIMEOUT_MAX = ... # type: float
class ThreadError(Exception): ...
@@ -86,7 +86,7 @@ class Lock:
exc_val: Optional[Exception],
exc_tb: Optional[TracebackType]) -> bool: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: int = ...) -> bool: ...
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
@@ -100,7 +100,7 @@ class _RLock:
exc_val: Optional[Exception],
exc_tb: Optional[TracebackType]) -> bool: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: int = ...) -> bool: ...
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
@@ -116,7 +116,7 @@ class Condition:
exc_val: Optional[Exception],
exc_tb: Optional[TracebackType]) -> bool: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: int = ...) -> bool: ...
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
@@ -136,7 +136,7 @@ class Semaphore:
exc_val: Optional[Exception],
exc_tb: Optional[TracebackType]) -> bool: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: int = ...) -> bool: ...
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
@@ -148,7 +148,7 @@ class BoundedSemaphore:
exc_val: Optional[Exception],
exc_tb: Optional[TracebackType]) -> bool: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: int = ...) -> bool: ...
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...