-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
from _collections_abc import dict_keys as real_dict_keys
from typing import TYPE_CHECKING
if TYPE_CHECKING:
dict_keys = real_dict_keys # type: ignore[misc]
else:
from typing import _alias # noqa
dict_keys = _alias(real_dict_keys, 2)
# test.py
def test_dict_keys():
typ = dict_keys[str, int]
dk1: typ = {'a': 1}.keys()
dk:2 typ = {1: 'a'}.keys() # type: ignore[assignment]
Metadata
Metadata
Assignees
Labels
No labels