Skip to content

Commit 54479ee

Browse files
authored
[conformance suite] Update an assertion in historical_positional.py to allow an optional error
The comment immediately above the `f3` definition states: ```py # > Consistent with PEP 570 syntax, positional-only parameters cannot appear # > after parameters that accept keyword arguments. Type checkers should # > enforce this requirement: ``` But mandating that type checkers should permit the `f3` definition appears inconsistent with this comment. The `x` parameter of this function accepts keyword arguments, and comes before a parameter that uses the legacy convention for denoting positional-only parameters, so according to the portion of the spec quoted here I think type checkers *should* emit an error on it. This PR updates the line to allow an optional error to be emitted by type checkers (though I'd personally also be okay with mandating an error).
1 parent 08f929b commit 54479ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

conformance/tests/historical_positional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def f1(__x: int, __y__: int = 0) -> None: ...
2626
def f2(x: int, __y: int) -> None: ... # E
2727

2828

29-
def f3(x: int, *args: int, __y: int) -> None: ... # OK
29+
def f3(x: int, *args: int, __y: int) -> None: ... # E?
3030

3131

3232
f3(3, __y=3) # OK

0 commit comments

Comments
 (0)