| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@BHUVANSH855 please do not keep merging main into your branch unless there is an actual merge conflict. |
Sorry, something went wrong.
There was a problem hiding this comment.
I think we should add a section header "Type parameter ordering", starting at line 487 or so. Currently this is in a section "Arbitrary generic types as base classes", which isn't really apposite.
Sorry, something went wrong.
|
Also, is this already covered sufficiently in the conformance suite? What are the relevant tests that we have? |
Sorry, something went wrong.
Addressed the requested changes:
There is already conformance coverage for Protocol[...] ordering in conformance/tests/protocols_generic.py. In particular, the Proto1(Iterable[T_co], Protocol[S, T_co]) example together with the specialization checks verifies that type parameter ordering follows the Protocol[...] subscript order. This PR expands the spec wording to make the broader ordering rules explicit, including Generic[...], parameterized Protocol[...], bare Protocol, and PEP 695 syntax. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Clarify how type parameter ordering is determined for generic classes.
This expands the existing wording in the generics spec to explicitly
cover:
The updated wording also clarifies that a bare Protocol base class
does not affect type parameter ordering.
Closes #2059