You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b45c105
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: conformance/results/mypy/callables_kwargs.toml
+2-8Lines changed: 2 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
conformant = "Partial"
2
2
notes = """
3
3
Allows callable without kwargs to be assigned to callable with unpacked kwargs.
4
-
Does not support the `closed` and `extra_items` TypedDict class arguments.
4
+
Does not support the `extra_items` TypedDict class argument.
5
5
Does not reject unpacking an open TypedDict in a call to a callable that has no `**kwargs`.
6
6
Does not reject unpacking an open TypedDict in a call to a callable whose `**kwargs` is typed with a closed TypedDict.
7
7
Does not check the type of an unpacked TypedDict's extra items against the target callable's `**kwargs` annotation.
@@ -10,12 +10,11 @@ Does not reject unpacking a TypedDict that sets `extra_items` in a call to a cal
10
10
Does not reject unpacking a TypedDict that sets `extra_items` in a call to a callable whose `**kwargs` is typed with a closed TypedDict.
11
11
"""
12
12
output = """
13
-
callables_kwargs.py:23: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]
14
13
callables_kwargs.py:27: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
15
14
callables_kwargs.py:55: error: Missing named argument "v1" for "func1" [call-arg]
16
15
callables_kwargs.py:55: error: Missing named argument "v3" for "func1" [call-arg]
17
16
callables_kwargs.py:60: error: Unexpected keyword argument "v4" for "func1" [call-arg]
18
-
callables_kwargs.py:61: error: Too many positional arguments for "func1" [misc]
17
+
callables_kwargs.py:61: error: Too many positional arguments for "func1" [call-arg]
19
18
callables_kwargs.py:67: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" [arg-type]
20
19
callables_kwargs.py:70: error: Argument 1 to "func1" has incompatible type "**dict[str, object]"; expected "int" [arg-type]
21
20
callables_kwargs.py:70: error: Argument 1 to "func1" has incompatible type "**dict[str, object]"; expected "str" [arg-type]
@@ -31,8 +30,6 @@ callables_kwargs.py:123: error: Incompatible types in assignment (expression has
31
30
callables_kwargs.py:123: note: "TDProtocol5.__call__" has type "def __call__(self, v1: int, v3: str) -> None"
32
31
callables_kwargs.py:131: error: Overlap between parameter names and ** TypedDict items: "v1" [misc]
33
32
callables_kwargs.py:142: error: Unpack item in ** parameter must be a TypedDict [misc]
34
-
callables_kwargs.py:166: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]
35
-
callables_kwargs.py:170: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]
36
33
callables_kwargs.py:174: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
37
34
callables_kwargs.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
38
35
callables_kwargs.py:182: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
@@ -60,10 +57,7 @@ Line 270: Expected 1 errors
60
57
Line 271: Expected 1 errors
61
58
Line 272: Expected 1 errors
62
59
Line 273: Expected 1 errors
63
-
Line 23: Unexpected errors ['callables_kwargs.py:23: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]']
64
60
Line 27: Unexpected errors ['callables_kwargs.py:27: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
65
-
Line 166: Unexpected errors ['callables_kwargs.py:166: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]']
66
-
Line 170: Unexpected errors ['callables_kwargs.py:170: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]']
67
61
Line 174: Unexpected errors ['callables_kwargs.py:174: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
68
62
Line 178: Unexpected errors ['callables_kwargs.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
69
63
Line 182: Unexpected errors ['callables_kwargs.py:182: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
Copy file name to clipboardExpand all lines: conformance/results/pyrefly/callables_kwargs.toml
+9-15Lines changed: 9 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,7 @@ conformant = "Partial"
2
2
notes = """
3
3
Does not reject unpacking an open TypedDict in a call to a callable that has no `**kwargs`.
4
4
Does not reject unpacking an open TypedDict in a call to a callable whose `**kwargs` is typed with a closed TypedDict.
5
-
Does not check the type of an unpacked TypedDict's extra items against the target callable's `**kwargs` annotation.
6
-
Does not check the type of an unpacked TypedDict's extra items against the target callable's named keyword parameters.
7
-
Does not reject unpacking a TypedDict that sets `extra_items` in a call to a callable that has no `**kwargs`.
8
-
Does not reject unpacking a TypedDict that sets `extra_items` in a call to a callable whose `**kwargs` is typed with a closed TypedDict.
9
-
Incorrectly rejects assigning a callable without `**kwargs` to a callable whose `**kwargs` is typed with a TypedDict that sets `extra_items=Never`.
5
+
Does not treat an open TypedDict as having extra items of type `object` when checking against the target callable's `**kwargs` annotation.
10
6
"""
11
7
conformance_automated = "Fail"
12
8
errors_diff = """
@@ -22,15 +18,6 @@ Line 241: Expected 1 errors
22
18
Line 243: Expected 1 errors
23
19
Line 244: Expected 1 errors
24
20
Line 245: Expected 1 errors
25
-
Line 264: Expected 1 errors
26
-
Line 265: Expected 1 errors
27
-
Line 267: Expected 1 errors
28
-
Line 268: Expected 1 errors
29
-
Line 270: Expected 1 errors
30
-
Line 271: Expected 1 errors
31
-
Line 272: Expected 1 errors
32
-
Line 273: Expected 1 errors
33
-
Line 156: Unexpected errors ["`(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol8` [bad-assignment]"]
34
21
"""
35
22
output = """
36
23
ERROR callables_kwargs.py:55:10-12: Missing argument `v1` in function `func1` [missing-argument]
@@ -50,5 +37,12 @@ ERROR callables_kwargs.py:123:19-24: `(**kwargs: Unpack[TD2]) -> None` is not as
50
37
ERROR callables_kwargs.py:131:20-41: TypedDict key 'v1' in **kwargs overlaps with parameter 'v1' [bad-function-definition]
51
38
ERROR callables_kwargs.py:142:21-30: `Unpack` in **kwargs annotation must be used only with a `TypedDict` [invalid-annotation]
52
39
ERROR callables_kwargs.py:154:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol6` [bad-assignment]
53
-
ERROR callables_kwargs.py:156:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol8` [bad-assignment]
40
+
ERROR callables_kwargs.py:264:16-23: `TDExtraItems` may contain extra items of type `int`, which cannot be unpacked into a callable that accepts no extra keyword arguments in function `takes_name` [unexpected-keyword]
41
+
ERROR callables_kwargs.py:265:27-34: Extra items of type `int` are not assignable to parameter `kwargs` with type `str` in function `takes_name_str_kwargs` [bad-argument-type]
42
+
ERROR callables_kwargs.py:267:16-24: `TDExtraItems` may contain extra items of type `int`, which cannot be unpacked into a callable that accepts no extra keyword arguments in function `takes_name` [unexpected-keyword]
43
+
ERROR callables_kwargs.py:268:27-35: Extra items of type `int` are not assignable to parameter `kwargs` with type `str` in function `takes_name_str_kwargs` [bad-argument-type]
44
+
ERROR callables_kwargs.py:270:18-25: `TDExtraItems` may contain extra items of type `int`, which cannot be unpacked into a callable that accepts no extra keyword arguments in function `takes_closed` [unexpected-keyword]
45
+
ERROR callables_kwargs.py:271:18-26: `TDExtraItems` may contain extra items of type `int`, which cannot be unpacked into a callable that accepts no extra keyword arguments in function `takes_closed` [unexpected-keyword]
46
+
ERROR callables_kwargs.py:272:37-44: Extra items of type `int` are not assignable to parameter `label` with type `str` in function `takes_optional_label_int_kwargs` [bad-argument-type]
47
+
ERROR callables_kwargs.py:273:37-45: Extra items of type `int` are not assignable to parameter `label` with type `str` in function `takes_optional_label_int_kwargs` [bad-argument-type]
0 commit comments