python / typing-council

Decisions by the Python Typing Council
41 stars 3 forks source link

Clarification on pre-3.8 way to specify positional-only parameters #19

Closed erictraut closed 6 months ago

erictraut commented 6 months ago

I'd like to request that the TC consider adoption of change to the typing spec that clarifies a type checking behavior related to positional-only parameters.

Links to PR & Discussion The PR can be found here.

The discussion can be found here.

TC Sign-off

Current Type Checker Behaviors None of the type checkers currently treat this situation as an error.

Controversial Issues The discussion generated some divergent opinions about "ambiguity 1" (whether self and cls should be implicitly positional-only). The spec change here doesn't (yet) address this point.

There was little or no controversy about "ambiguity 2" (whether it should be considered an error if a positional-only parameter follows a non-positional-only parameter). This change addresses only this part of the discussion.

hauntsaninja commented 6 months ago

(I think you mean ambiguity 2 in your last paragraph)

gvanrossum commented 6 months ago

I voted. I'm okay with the PR as it is; I have one purely textual nit and one thought about arguments vs. parameters...