Skip to content

Commit 8e3f28a

Browse files
committed
Enable PYI059
1 parent 576a71a commit 8e3f28a

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ select = [
108108
"PYI044", # `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics
109109
"PYI055", # Multiple `type[T]` usages in a union. Combine them into one, e.g., `type[{union_str}]`.
110110
"PYI058", # Use `{return_type}` as the return value for simple `{method}` methods
111-
# "PYI059", # TODO: Add when dropping Python 3.9 support
111+
"PYI059", # Checks for classes inheriting from typing.Generic[] where Generic[] is not the last base class in the bases tuple
112112
"PYI061", # Use `None` rather than `Literal[None]`
113113
"PYI062", # Duplicate literal member `{}`
114114
"PYI064", # `Final[Literal[{literal}]]` can be replaced with a bare Final

stdlib/asyncio/queues.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ _T = TypeVar("_T")
2424
if sys.version_info >= (3, 13):
2525
class QueueShutDown(Exception): ...
2626

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

0 commit comments

Comments
 (0)