From 54479ee4002497ec2cefb6fc86842aaaca7c262a Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 31 Jan 2026 10:15:42 +0000 Subject: [PATCH] [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). --- conformance/tests/historical_positional.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/historical_positional.py b/conformance/tests/historical_positional.py index 4fc0aaa6a..49e3c05a4 100644 --- a/conformance/tests/historical_positional.py +++ b/conformance/tests/historical_positional.py @@ -26,7 +26,7 @@ def f1(__x: int, __y__: int = 0) -> None: ... def f2(x: int, __y: int) -> None: ... # E -def f3(x: int, *args: int, __y: int) -> None: ... # OK +def f3(x: int, *args: int, __y: int) -> None: ... # E? f3(3, __y=3) # OK