Skip to content

Commit 770b585

Browse files
committed
change wording from may -> should, make error required
1 parent 08142e8 commit 770b585

8 files changed

Lines changed: 60 additions & 12 deletions

File tree

‎conformance/results/mypy/callables_kwargs.toml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ callables_kwargs.py:178: error: Unexpected keyword argument "extra_items" for "_
3737
conformance_automated = "Fail"
3838
errors_diff = """
3939
Line 154: Expected 1 errors
40+
Line 210: Expected 1 errors
4041
Line 212: Expected 1 errors
42+
Line 213: Expected 1 errors
4143
Line 215: Expected 1 errors
44+
Line 216: Expected 1 errors
45+
Line 217: Expected 1 errors
46+
Line 221: Expected 1 errors
4247
Line 223: Expected 1 errors
48+
Line 224: Expected 1 errors
4349
Line 226: Expected 1 errors
50+
Line 227: Expected 1 errors
51+
Line 228: Expected 1 errors
4452
Line 243: Expected 1 errors
4553
Line 244: Expected 1 errors
4654
Line 246: Expected 1 errors

‎conformance/results/pycroscope/callables_kwargs.toml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ Incorrectly rejects assigning a callable without `**kwargs` to a callable whose
88
"""
99
conformance_automated = "Fail"
1010
errors_diff = """
11+
Line 210: Expected 1 errors
1112
Line 212: Expected 1 errors
13+
Line 213: Expected 1 errors
1214
Line 215: Expected 1 errors
15+
Line 216: Expected 1 errors
16+
Line 217: Expected 1 errors
17+
Line 221: Expected 1 errors
1318
Line 223: Expected 1 errors
19+
Line 224: Expected 1 errors
1420
Line 226: Expected 1 errors
21+
Line 227: Expected 1 errors
22+
Line 228: Expected 1 errors
1523
Line 243: Expected 1 errors
1624
Line 244: Expected 1 errors
1725
Line 246: Expected 1 errors

‎conformance/results/pyrefly/callables_kwargs.toml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ Incorrectly rejects assigning a callable without `**kwargs` to a callable whose
88
"""
99
conformance_automated = "Fail"
1010
errors_diff = """
11+
Line 210: Expected 1 errors
1112
Line 212: Expected 1 errors
13+
Line 213: Expected 1 errors
1214
Line 215: Expected 1 errors
15+
Line 216: Expected 1 errors
16+
Line 217: Expected 1 errors
17+
Line 221: Expected 1 errors
1318
Line 223: Expected 1 errors
19+
Line 224: Expected 1 errors
1420
Line 226: Expected 1 errors
21+
Line 227: Expected 1 errors
22+
Line 228: Expected 1 errors
1523
Line 243: Expected 1 errors
1624
Line 244: Expected 1 errors
1725
Line 246: Expected 1 errors

‎conformance/results/pyright/callables_kwargs.toml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ callables_kwargs.py:247:29 - error: Argument of type "int" cannot be assigned to
5050
"""
5151
conformance_automated = "Fail"
5252
errors_diff = """
53+
Line 210: Expected 1 errors
54+
Line 213: Expected 1 errors
55+
Line 216: Expected 1 errors
56+
Line 217: Expected 1 errors
57+
Line 221: Expected 1 errors
58+
Line 224: Expected 1 errors
59+
Line 227: Expected 1 errors
60+
Line 228: Expected 1 errors
5361
Line 243: Expected 1 errors
5462
Line 246: Expected 1 errors
5563
Line 249: Expected 1 errors

‎conformance/results/ty/callables_kwargs.toml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
conformant = "Pass"
2-
conformance_automated = "Pass"
2+
conformance_automated = "Fail"
33
errors_diff = """
4+
Line 210: Expected 1 errors
5+
Line 213: Expected 1 errors
6+
Line 216: Expected 1 errors
7+
Line 217: Expected 1 errors
8+
Line 221: Expected 1 errors
9+
Line 224: Expected 1 errors
10+
Line 227: Expected 1 errors
11+
Line 228: Expected 1 errors
412
"""
513
output = """
614
callables_kwargs.py:55:5: error[missing-argument] No arguments provided for required parameters `v1`, `v3` of function `func1`

‎conformance/results/zuban/callables_kwargs.toml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ Incorrectly rejects assigning a callable without `**kwargs` to a callable whose
66
"""
77
conformance_automated = "Fail"
88
errors_diff = """
9+
Line 210: Expected 1 errors
910
Line 212: Expected 1 errors
11+
Line 213: Expected 1 errors
1012
Line 215: Expected 1 errors
13+
Line 216: Expected 1 errors
14+
Line 217: Expected 1 errors
15+
Line 221: Expected 1 errors
1116
Line 223: Expected 1 errors
17+
Line 224: Expected 1 errors
1218
Line 226: Expected 1 errors
19+
Line 227: Expected 1 errors
20+
Line 228: Expected 1 errors
1321
Line 243: Expected 1 errors
1422
Line 246: Expected 1 errors
1523
Line 155: Unexpected errors ['callables_kwargs.py:155: error: Incompatible types in assignment (expression has type "def func7(*, v1: int, v3: str, v2: str = ...) -> None", variable has type "TDProtocol7") [assignment]']

‎conformance/tests/callables_kwargs.py‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,29 +203,29 @@ def takes_closed(**kwargs: Unpack[TDClosed]) -> None:
203203
...
204204

205205

206-
# > Therefore, it is only safe to unpack a non-:term:`closed` TypedDict in a function call
207-
# > if that function has ``**kwargs`` in its signature, and any :term:`extra items` are assignable to the type of ``**kwargs``.
206+
# > It is only safe to unpack a non-:term:`closed` TypedDict in a function call if that function has
207+
# > ``**kwargs`` in its signature, and any :term:`extra items` are assignable to the type of ``**kwargs``.
208208

209209
def open_implicit(value: TDOpenImplicit, **kwargs: Unpack[TDOpenImplicit]) -> None:
210-
takes_name(**value) # E?: a subtype may contain unknown keys
210+
takes_name(**value) # E: a subtype may contain unknown keys
211211
takes_name_kwargs(**value)
212212
takes_name_str_kwargs(**value) # E: extra items type is not compatible
213-
takes_name(**kwargs) # E?: a subtype may contain unknown keys
213+
takes_name(**kwargs) # E: a subtype may contain unknown keys
214214
takes_name_kwargs(**kwargs)
215215
takes_name_str_kwargs(**kwargs) # E: extra items type is not compatible
216-
takes_closed(**value) # E?: a subtype may contain unknown keys
217-
takes_closed(**kwargs) # E?: a subtype may contain unknown keys
216+
takes_closed(**value) # E: a subtype may contain unknown keys
217+
takes_closed(**kwargs) # E: a subtype may contain unknown keys
218218

219219

220220
def open_explicit(value:TDOpenExplicit, **kwargs: Unpack[TDOpenExplicit]) -> None:
221-
takes_name(**value) # E?: a subtype may contain unknown keys
221+
takes_name(**value) # E: a subtype may contain unknown keys
222222
takes_name_kwargs(**value)
223223
takes_name_str_kwargs(**value) # E: extra items type is not compatible
224-
takes_name(**kwargs) # E?: a subtype may contain unknown keys
224+
takes_name(**kwargs) # E: a subtype may contain unknown keys
225225
takes_name_kwargs(**kwargs)
226226
takes_name_str_kwargs(**kwargs) # E: extra items type is not compatible
227-
takes_closed(**value) # E?: a subtype may contain unknown keys
228-
takes_closed(**kwargs) # E?: a subtype may contain unknown keys
227+
takes_closed(**value) # E: a subtype may contain unknown keys
228+
takes_closed(**kwargs) # E: a subtype may contain unknown keys
229229

230230

231231
def kwargs_closed(value: TDClosed, **kwargs: Unpack[TDClosed]) -> None:

‎docs/spec/callables.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ Therefore, it is only safe to unpack a non-:term:`closed` TypedDict in a functio
417417
if that function has ``**kwargs`` in its signature, and any :term:`extra items` are assignable to the type of ``**kwargs``.
418418

419419
- If the function being called has ``**kwargs``, checkers should error if the TypedDict's :term:`extra items` are not assignable to the type of ``**kwargs``. For this rule, :term:`open` TypedDicts are treated as having extra items of type ``object``.
420-
- If the function being called does not have ``**kwargs``, checkers may error if the TypedDict is :term:`open`, and should error if the TypedDict declares non-``Never`` :term:`extra items`.
420+
- If the function being called does not have ``**kwargs``, checkers should error if the TypedDict is :term:`open`, and should error if the TypedDict declares non-``Never`` :term:`extra items`.
421421

422422
In cases similar to the ``bar`` function above the problem could be worked
423423
around by marking ``Animal`` with ``closed=True``, or by explicitly dereferencing desired

0 commit comments

Comments
 (0)