FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Enable PYI059 by srittau · Pull Request #15399 · python/typeshed · GitHub

Repository navigation

Enable PYI059 - #15399

Merged
srittau merged 4 commits into
python:mainfrom
srittau:pyi059
May 7, 2026
Merged

srittau merged 4 commits into
python:mainfrom
srittau:pyi059

Conversation

srittau commented Feb 9, 2026 •
edited
Loading

Copy link
Copy Markdown
Collaborator

No description provided.

srittau commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator Author

Part of #15358.

This comment has been minimized.

Copy link
Copy Markdown
Member

This can only be done at the same time as removing the second branch here:

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

This comment has been minimized.

srittau commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator Author

This can only be done at the same time as removing the second branch here:

ruff disagrees. :P

AlexWaygood commented Feb 9, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

Ohhh, CI now passes here because you removed the pyright-3.9 CI check in the other PR. Hmm, but I'd still lean towards removing the second branch here at the same time as rearranging the order of the base classes? Pyright's previous complaint -- which is what prompted the noqa suppression -- was not a false positive. It was accurately flagging that it really is impossible for type checkers to infer the MRO of a class that inherits from two bases where the first is object and the second is Generic[_T]. It fails at runtime too; there's no way for C3 linearisation to succeed with that sequence of bases:

>>> from typing import Generic, TypeVar
>>> _T = TypeVar("_T")
>>> _LoopBoundMixin = object
>>> class Queue(_LoopBoundMixin, Generic[_T]): ...
... 
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    class Queue(_LoopBoundMixin, Generic[_T]): ...
TypeError: Cannot create a consistent method resolution order (MRO) for bases object, Generic

srittau added the status: deferred Issue or PR deferred until some precondition is fixed label Feb 9, 2026

srittau commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator Author

Makes sense. I've deferred this for now, and added it to #13782.

srittau mentioned this pull request Feb 9, 2026
12 of 13 tasks
srittau marked this pull request as draft February 9, 2026 13:49

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

srittau marked this pull request as ready for review May 7, 2026 18:35
srittau removed the status: deferred Issue or PR deferred until some precondition is fixed label May 7, 2026
srittau requested a review from AlexWaygood May 7, 2026 18:36
srittau merged commit c8c5e9e into python:main May 7, 2026
36 checks passed
srittau deleted the pyi059 branch May 7, 2026 22:10
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL