Skip to content

Replace typing_extensions -> typing in examples #1987

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

Merged
merged 5 commits into from
Aug 20, 2025

Conversation

smheidrich
Copy link
Contributor

Fixes #1986.

from typing_extensions import Never
from typing import Never
Copy link
Member

Choose a reason for hiding this comment

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

Let's discuss on the issue for now

@srittau srittau added the topic: documentation Documentation-related issues and PRs label Aug 20, 2025
Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks, and sorry for the delay. I think your hybrid approach is the best of both worlds. A few remarks below.

@@ -54,7 +54,7 @@ As an example, consider this simple calculator:
.. code:: python

import enum
from typing_extensions import Never
from typing import Never
Copy link
Collaborator

Choose a reason for hiding this comment

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

Never needs an infobox as well. (Added in Python 3.11.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I didn't add it for that one because it's already explained in the prose at the start of the page; but I've added an additional infobox below the code snippet now for consistency (and perhaps easier discoverability for people who only skim the page) 👍

@srittau srittau merged commit 63534a9 into python:main Aug 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Documentation-related issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examples shouldn't use typing_extensions imports for stable typing features
3 participants