-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SimpleQueue and Empty live in _queue (#12979)
- Loading branch information
Showing
4 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import sys | ||
from typing import Any, Generic, TypeVar | ||
|
||
if sys.version_info >= (3, 9): | ||
from types import GenericAlias | ||
|
||
_T = TypeVar("_T") | ||
|
||
class Empty(Exception): ... | ||
|
||
class SimpleQueue(Generic[_T]): | ||
def __init__(self) -> None: ... | ||
def empty(self) -> bool: ... | ||
def get(self, block: bool = True, timeout: float | None = None) -> _T: ... | ||
def get_nowait(self) -> _T: ... | ||
def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ... | ||
def put_nowait(self, item: _T) -> None: ... | ||
def qsize(self) -> int: ... | ||
if sys.version_info >= (3, 9): | ||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters