8000 Simplify `pyrightconfig.json` , add missing comments and extra strict settings in all pyright configs by Avasam · Pull Request #9714 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Simplify pyrightconfig.json , add missing comments and extra strict settings in all pyright configs #9714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pr comment
Incidentally also test generic params inferred from __init__ call
  • Loading branch information
Avasam committed Feb 12, 2023
commit b321523821bec28d5a1abd6102e9a3de6d74d87d
9 changes: 6 additions & 3 deletions test_cases/stdlib/builtins/check_dict.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@


class KeysAndGetItem(Generic[_KT, _VT]):
data: dict[_KT, _VT] = {}
data: dict[_KT, _VT]

def __init__(self, data: dict[_KT, _VT]):
self.data = data

def keys(self) -> Iterable[_KT]:
return self.data.keys()
Expand All @@ -27,11 +30,11 @@ def __getitem__(self, __k: _KT) -> _VT:
return self.data[__k]


kt1: KeysAndGetItem[int, str] = KeysAndGetItem()
kt1: KeysAndGetItem[int, str] = KeysAndGetItem({0: ""})
assert_type(dict(kt1), Dict[int, str])
dict(kt1, arg="a") # type: ignore

kt2: KeysAndGetItem[str, int] = KeysAndGetItem()
kt2: KeysAndGetItem[str, int] = KeysAndGetItem({"": 0})
assert_type(dict(kt2, arg=1), Dict[str, int])


Expand Down
0