Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document new type parameter syntax (PEP 695) #17810

Closed
JukkaL opened this issue Sep 23, 2024 · 3 comments · Fixed by #17826
Closed

Document new type parameter syntax (PEP 695) #17810

JukkaL opened this issue Sep 23, 2024 · 3 comments · Fixed by #17826
Assignees
Labels
documentation topic-pep-695 Issues related to PEP 695 syntax

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Sep 23, 2024

#15238 is about overall support for PEP 695.

@TeamSpen210
Copy link
Contributor

This might be overcomplicating things, but Cython has a similar need to display two code styles, which they handle via the sphinx-tabs extension. That allows only showing the variant you want to use, making the page a little easier to read. If these are sticking around for a while in docs, maybe Mypy should do the same?

@JukkaL
Copy link
Collaborator Author

JukkaL commented Sep 25, 2024

An interesting idea. I don't have a strong opinion -- we'd need to experiment with it before making a decision. I'm not going to switch to tabs at the moment, but we can consider it in the future.

JukkaL added a commit that referenced this issue Sep 25, 2024
Provide examples using both syntax variants, and give both of the syntax
variants similar prominence. It's likely that both syntax variants will
continue to be widely used for a long time.

Also adjust terminology (e.g. use 'type parameter' / 'type argument'
more consistently), since otherwise some descriptions would be unclear.

I didn't update examples outside the generics chapter. I'll do this in a
follow-up PR.

Work on #17810.

---------

Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Brian Schubert <[email protected]>
@JukkaL JukkaL closed this as completed in 7f3d7f8 Sep 25, 2024
@cdce8p
Copy link
Collaborator

cdce8p commented Dec 7, 2024

This might be overcomplicating things, but Cython has a similar need to display two code styles, which they handle via the sphinx-tabs extension. That allows only showing the variant you want to use, making the page a little easier to read. If these are sticking around for a while in docs, maybe Mypy should do the same?

Opened #18264 so we can decide if it's helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation topic-pep-695 Issues related to PEP 695 syntax
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants