Skip to content

ParamSpec must not raise errors on valid attr access #13472

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 3 commits into from
Aug 21, 2022
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
Add one more test
  • Loading branch information
sobolevn committed Aug 21, 2022
commit 025552c6954c1e2efac50746b8ae801a078b2522
10 changes: 10 additions & 0 deletions test-data/unit/check-parameter-specification.test
Original file line number Diff line number Diff line change
Expand Up @@ -1151,4 +1151,14 @@ def func2(callback: Callable[P1, str]) -> Callable[P1, str]:
) -> str:
return "foo"
return inner

def func3(callback: Callable[P1, str]) -> Callable[P1, str]:
def inner(
*args: P1.__bound__, # E: Use "P1.args" for variadic "*" parameter \
# E: Name "P1.__bound__" is not defined
**kwargs: P1.invalid, # E: Use "P1.kwargs" for variadic "**" parameter \
# E: Name "P1.invalid" is not defined
) -> str:
return "foo"
return inner
[builtins fixtures/paramspec.pyi]