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

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