Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ select = [
"PYI044", # `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
"PYI055", # Multiple `type[T]` usages in a union. Combine them into one, e.g., `type[{union_str}]`.
"PYI058", # Use `{return_type}` as the return value for simple `{method}` methods
# "PYI059", # TODO: Add when dropping Python 3.9 support
"PYI059", # Checks for classes inheriting from typing.Generic[] where Generic[] is not the last base class in the bases tuple
"PYI061", # Use `None` rather than `Literal[None]`
"PYI062", # Duplicate literal member `{}`
"PYI064", # `Final[Literal[{literal}]]` can be replaced with a bare Final
Expand Down
9 changes: 2 additions & 7 deletions stdlib/asyncio/queues.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ from asyncio.events import AbstractEventLoop
from types import GenericAlias
from typing import Any, Generic, TypeVar

if sys.version_info >= (3, 10):
from .mixins import _LoopBoundMixin
else:
_LoopBoundMixin = object
from .mixins import _LoopBoundMixin

class QueueEmpty(Exception): ...
class QueueFull(Exception): ...
Expand All @@ -24,9 +21,7 @@ _T = TypeVar("_T")
if sys.version_info >= (3, 13):
class QueueShutDown(Exception): ...

# If Generic[_T] is last and _LoopBoundMixin is object, pyright is unhappy.
# We can remove the noqa pragma when dropping 3.9 support.
class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059
class Queue(_LoopBoundMixin, Generic[_T]):
if sys.version_info >= (3, 10):
def __init__(self, maxsize: int = 0) -> None: ...
else:
Expand Down