mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Make Queue generic in Python 2, similar to Python 3 (#155)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
# Stubs for Queue (Python 2)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, TypeVar, Generic
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class Empty(Exception): ...
|
||||
class Full(Exception): ...
|
||||
|
||||
class Queue:
|
||||
class Queue(Generic[_T]):
|
||||
maxsize = ... # type: Any
|
||||
mutex = ... # type: Any
|
||||
not_empty = ... # type: Any
|
||||
@@ -20,10 +20,10 @@ class Queue:
|
||||
def qsize(self) -> int: ...
|
||||
def empty(self) -> bool: ...
|
||||
def full(self) -> bool: ...
|
||||
def put(self, item: Any, block: bool = ..., timeout: float = ...) -> None: ...
|
||||
def put_nowait(self, item) -> None: ...
|
||||
def get(self, block: bool = ..., timeout: float = ...) -> Any: ...
|
||||
def get_nowait(self) -> Any: ...
|
||||
def put(self, item: _T, block: bool = ..., timeout: float = ...) -> None: ...
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
def get(self, block: bool = ..., timeout: float = ...) -> _T: ...
|
||||
def get_nowait(self) -> _T: ...
|
||||
|
||||
class PriorityQueue(Queue): ...
|
||||
class LifoQueue(Queue): ...
|
||||
|
||||
Reference in New Issue
Block a user