Closed
Description
Type checkers that include the recent changes from #8977 #9058 (e.g. pyright v1.1.281) now incorrectly emit an error like Member "register" is unknown
for the following line of code:
Type checkers that do not include those changes (e.g. pyright v1.1.278) do not emit any error for that line, as expected.
Copy/pasted excerpt:
import typing as t
from ._typing import KT # a typevar
class BidictKeysView(t.KeysView[KT], t.ValuesView[KT]):
"""Since the keys of a bidict are the values of its inverse (and vice versa),
the :class:`~collections.abc.ValuesView` result of calling *bi.values()*
is also a :class:`~collections.abc.KeysView` of *bi.inverse*.
"""
dict_keys: t.Type[t.KeysView[t.Any]] = type({}.keys())
BidictKeysView.register(dict_keys) # <-- false positive error emitted here
Please let me know if there is any other info I can provide. Thank you!
Metadata
Metadata
Assignees
Labels
No labels