Update unpack TypedDict kwargs forwarding spec + add conformance tests by yangdanny97 · Pull Request #2338 · python/typing · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
81 changes: 61 additions & 20 deletions conformance/results/mypy/callables_kwargs.toml
55 changes: 40 additions & 15 deletions conformance/results/pycroscope/callables_kwargs.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
conformance_automated = "Pass"
conformant = "Partial"
notes = """
Does not reject unpacking an open TypedDict in a call to a callable that has no `**kwargs`.
Does not reject unpacking an open TypedDict in a call to a callable whose `**kwargs` is typed with a closed TypedDict.
"""
conformance_automated = "Fail"
errors_diff = """
Line 223: Expected 1 errors
Line 226: Expected 1 errors
Line 229: Expected 1 errors
Line 230: Expected 1 errors
Line 238: Expected 1 errors
Line 241: Expected 1 errors
Line 244: Expected 1 errors
Line 245: Expected 1 errors
"""
output = """
./callables_kwargs.py:46:4: In call to callables_kwargs.func1: Missing required argument 'v1' [incompatible_call]
./callables_kwargs.py:51:4: In call to callables_kwargs.func1: Got an unexpected keyword argument 'v4' [incompatible_call]
./callables_kwargs.py:52:4: In call to callables_kwargs.func1: Missing required argument 'v1' [incompatible_call]
./callables_kwargs.py:58:4: Incompatible argument type for v1: expected int but got str [incompatible_argument]
./callables_kwargs.py:61:4: In call to callables_kwargs.func1: Got an unexpected keyword argument 'v4' [incompatible_call]
./callables_kwargs.py:63:4: Multiple values provided for argument 'v1' [incompatible_call]
./callables_kwargs.py:64:4: In call to callables_kwargs.func2: Parameter 'v3' provided as both a positional and a keyword argument [incompatible_call]
./callables_kwargs.py:65:4: Multiple values provided for argument 'v1' [incompatible_call]
./callables_kwargs.py:101:0: Incompatible assignment: expected callables_kwargs.TDProtocol3, got function 'callables_kwargs.func1' [incompatible_assignment]
./callables_kwargs.py:102:0: Incompatible assignment: expected callables_kwargs.TDProtocol4, got function 'callables_kwargs.func1' [incompatible_assignment]
./callables_kwargs.py:103:0: Incompatible assignment: expected callables_kwargs.TDProtocol5, got function 'callables_kwargs.func1' [incompatible_assignment]
./callables_kwargs.py:111:21: Parameter v1 overlaps with TypedDict key in **kwargs [invalid_annotation]
./callables_kwargs.py:122:12: Expected TypedDict type inside Unpack[] for **kwargs [invalid_annotation]
./callables_kwargs.py:134:0: Incompatible assignment: expected callables_kwargs.TDProtocol6, got function 'callables_kwargs.func7' [incompatible_assignment]
./callables_kwargs.py:55:4: In call to callables_kwargs.func1: Missing required argument 'v1' [incompatible_call]
./callables_kwargs.py:60:4: In call to callables_kwargs.func1: Got an unexpected keyword argument 'v4' [incompatible_call]
./callables_kwargs.py:61:4: In call to callables_kwargs.func1: Missing required argument 'v1' [incompatible_call]
./callables_kwargs.py:67:4: Incompatible argument type for v1: expected int but got str [incompatible_argument]
./callables_kwargs.py:70:4: In call to callables_kwargs.func1: Got an unexpected keyword argument 'v4' [incompatible_call]
./callables_kwargs.py:72:4: Multiple values provided for argument 'v1' [incompatible_call]
./callables_kwargs.py:73:4: In call to callables_kwargs.func2: Parameter 'v3' provided as both a positional and a keyword argument [incompatible_call]
./callables_kwargs.py:74:4: Multiple values provided for argument 'v1' [incompatible_call]
./callables_kwargs.py:121:0: Incompatible assignment: expected callables_kwargs.TDProtocol3, got function 'callables_kwargs.func1' [incompatible_assignment]
./callables_kwargs.py:122:0: Incompatible assignment: expected callables_kwargs.TDProtocol4, got function 'callables_kwargs.func1' [incompatible_assignment]
./callables_kwargs.py:123:0: Incompatible assignment: expected callables_kwargs.TDProtocol5, got function 'callables_kwargs.func1' [incompatible_assignment]
./callables_kwargs.py:131:21: Parameter v1 overlaps with TypedDict key in **kwargs [invalid_annotation]
./callables_kwargs.py:142:12: Expected TypedDict type inside Unpack[] for **kwargs [invalid_annotation]
./callables_kwargs.py:154:0: Incompatible assignment: expected callables_kwargs.TDProtocol6, got function 'callables_kwargs.func7' [incompatible_assignment]
./callables_kwargs.py:225:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str?: object}}> [incompatible_argument]
./callables_kwargs.py:228:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str?: object}}> [incompatible_argument]
./callables_kwargs.py:240:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str?: object}}> [incompatible_argument]
./callables_kwargs.py:243:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str?: object}}> [incompatible_argument]
./callables_kwargs.py:264:4: In call to callables_kwargs.takes_name: **kwargs provided but not used [incompatible_call]
./callables_kwargs.py:265:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str: int}}> [incompatible_argument]
./callables_kwargs.py:267:4: In call to callables_kwargs.takes_name: **kwargs provided but not used [incompatible_call]
./callables_kwargs.py:268:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str: int}}> [incompatible_argument]
./callables_kwargs.py:270:4: In call to callables_kwargs.takes_closed: **kwargs provided but not used [incompatible_call]
./callables_kwargs.py:271:4: In call to callables_kwargs.takes_closed: **kwargs provided but not used [incompatible_call]
./callables_kwargs.py:272:4: Incompatible argument type for label: expected str but got int [incompatible_argument]
./callables_kwargs.py:273:4: Incompatible argument type for label: expected str but got int [incompatible_argument]
"""
69 changes: 50 additions & 19 deletions conformance/results/pyrefly/callables_kwargs.toml
Loading