Skip to content

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jan 31, 2026

The comment immediately above the f3 definition states:

# > 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).

… 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).
@AlexWaygood AlexWaygood changed the title [conformance suite] Update an assertion in historical_positional.py [conformance suite] Update an assertion in historical_positional.py to allow an optional error Jan 31, 2026
@srittau srittau added the topic: conformance tests Issues with the conformance test suite label Feb 1, 2026
Copy link
Member

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think type checkers should be allowed to reject this definition.

@AlexWaygood AlexWaygood merged commit f98d75e into main Feb 9, 2026
5 checks passed
@AlexWaygood AlexWaygood deleted the alex/historical-positional-assertion branch February 9, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: conformance tests Issues with the conformance test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants