mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-21 19:32:13 +08:00
Fix false positive with calling .register() on KeysView subclass (#9348)
* Revert "`Collection` is `Sized` (#8977)" This reverts commit5bbba5d008. * Revert "typing: remove metaclass from Sized (#9058)" This reverts commita3ce512095. * Add regression test for issue 9296.
This commit is contained in:
16
test_cases/stdlib/typing/check_regression_issue_9296.py
Normal file
16
test_cases/stdlib/typing/check_regression_issue_9296.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
|
||||
KT = t.TypeVar("KT")
|
||||
|
||||
|
||||
class MyKeysView(t.KeysView[KT]):
|
||||
pass
|
||||
|
||||
|
||||
d: dict[t.Any, t.Any] = {}
|
||||
dict_keys = type(d.keys())
|
||||
|
||||
# This should not cause an error like `Member "register" is unknown`:
|
||||
MyKeysView.register(dict_keys)
|
||||
Reference in New Issue
Block a user