GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-132941: Soft deprecate various typing classes by srittau · Pull Request #154480 · python/cpython

Conversation

@srittau

@srittau srittau commented Jul 22, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Also use the newer type var syntax in a few places.

This PR does not deprecated TypeVar, ParamSpec, and TypeVarTuple
constructors, as it is sometimes necessary to create type vars using the
explicit syntax. (For example to create a shared type var like AnyStr or
to use it as a type form.)

Cc @JelleZijlstra

  • Issue: typing docs: Use soft deprecation #132941

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@srittau
Soft deprecate various typing classes
b410a8b
Also use the newer type var syntax in a few places.
@srittau
srittau requested review from AlexWaygood and JelleZijlstra as code owners July 22, 2026 12:10
@bedevere-app bedevere-app Bot added the docs Documentation in the Doc dir label Jul 22, 2026
@github-project-automation github-project-automation Bot added this to Docs PRs Jul 22, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Jul 22, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jul 22, 2026
typing docs: Use soft deprecation #132941
Open
@bedevere-app bedevere-app Bot added the awaiting review label Jul 22, 2026
@srittau
Fix missing space
6013f1f
@read-the-docs-community

read-the-docs-community Bot commented Jul 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35480928 | 📁 Comparing d78de26 against main (771abfe)

  🔍 Preview build  

430 files changed · + 10 added · ± 420 modified

+ Added

  • builtins/constants.html
  • builtins/exceptions.html
  • builtins/functions.html
  • builtins/index.html
  • builtins/stdtypes.html
  • builtins/threadsafety.html
  • builtins/time-complexity.html
  • c-api/pyexpat.html
  • library/time-complexity.html
  • library/tkinter.dialogs.html

± Modified

  • glossary.html
  • index.html
  • license.html
  • py-modindex.html
  • _static/tachyon-example-heatmap.html
  • c-api/arg.html
  • c-api/bool.html
  • c-api/buffer.html
  • c-api/bytearray.html
  • c-api/bytes.html
  • and 410 more...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn
sobolevn reviewed Jul 22, 2026
View reviewed changes

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Great stuff!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/types.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra
JelleZijlstra reviewed Jul 22, 2026
View reviewed changes
Comment thread Doc/library/typing.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Jul 22, 2026
View reviewed changes
Comment thread Doc/library/types.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

srittau added 4 commits July 22, 2026 16:15
@srittau
Add missing type parameters
bb72945
@srittau
Use soft deprecation marker
467ec51
@srittau
Add items to the soft deprecations document
65cf186
@srittau
Add items to deprecations table
f867aeb
@Viicos Viicos mentioned this pull request Aug 6, 2026
gh-105499: Avoid using functools.reduce() to reconstruct Union objects #155280
Merged
@srittau
Merge branch 'main' into typing-deprecations
c94c53b
@srittau

srittau commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@JelleZijlstra @AlexWaygood Sorry to bother you, but could one of you review and merge this. While I only have 2 PRs open at the moment against CPython, I'm a bit worried about hitting the new 3 PR limit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented Oct 20, 2026

Copy link
Copy Markdown
Member

While I only have 2 PRs open at the moment against CPython, I'm a bit worried about hitting the new 3 PR limit.

No need to worry, we'll add you to the exclusion list. :-)

srittau reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@srittau

srittau commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

While I only have 2 PRs open at the moment against CPython, I'm a bit worried about hitting the new 3 PR limit.

No need to worry, we'll add you to the exclusion list. :-)

Couldn't you have mentioned this after I strong-armed these two into merging this PR? 😇

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra

JelleZijlstra commented Oct 20, 2026

Copy link
Copy Markdown
Member

I guess I don't need to do anything here?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@srittau

srittau commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

I guess I don't need to do anything here?

A review and (potential) merge would still be welcome, but became a bit less pressing for me.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra
JelleZijlstra reviewed Oct 20, 2026
View reviewed changes
Comment thread Doc/deprecations/soft-deprecations.rst Outdated
* :class:`typing.Optional` in favor of the dedicated union syntax
(``X | None``)
* :class:`typing.NoReturn` in favor of :class:`typing.Never`
* :class:`typing.ForwardRef` in favor of :class:`annotationlib.ForwardRef`

@JelleZijlstra JelleZijlstra Oct 20, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

These last two are actually just aliases. Perhaps it's clearer to mention them separately?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@srittau srittau Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What exactly do you have in mind? As a whole new top-level item, a new sub-list inside this item, or just change "The following typing-related classes are :term:soft deprecated:" to "The following typing-related classes and aliases ..."?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JelleZijlstra JelleZijlstra Oct 20, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I was thinking of just having two lists.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@srittau srittau Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I've done that, but it looks a bit weird to me to separate the aliases from the rest of the typing-related items.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/types.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/typing.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/typing.rst
See :pep:`585` and :ref:`types-genericalias`.

.. class:: List(list, MutableSequence[T])
.. class:: List[T](list, MutableSequence[T])

@JelleZijlstra JelleZijlstra Oct 20, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Unrelated but presenting List as a subclass of list is somewhat confusing

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@srittau srittau Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Indeed, but it's consistent with the other classes in this doc (e.g. Set[T](set, MutableSet[T])).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
srittau and others added 2 commits October 20, 2026 20:31
@srittau @JelleZijlstra
Use a semicolon
66f5110
Co-authored-by: Jelle Zijlstra <[email protected]>
@srittau
Split aliases from classes
000a298
JelleZijlstra
JelleZijlstra reviewed Oct 20, 2026
View reviewed changes
Comment thread Doc/deprecations/soft-deprecations.rst Outdated

* The following typing-related aliases are :term:`soft deprecated`:

* :class:`typing.NoReturn` in favor of :class:`typing.Never`

@JelleZijlstra JelleZijlstra Oct 20, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sorry NoReturn is not an alias, but types.UnionType is.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@srittau srittau Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I've moved it. I think it would be cleanest to use sub-headers, i.e. one for "re module" and one for "Typing-related". And then use one bullet point per item. But I'm not sure if that's in the spirit of the document.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
srittau and others added 2 commits October 20, 2026 20:46
@srittau
Reshuffle deprecations document
3b2eb5a
@srittau
Suggest X | Y in deprecation message
31b9a9f
@srittau
Merge branch 'main' into typing-deprecations
d78de26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@sobolevn sobolevn sobolevn left review comments
@StanFromIreland StanFromIreland StanFromIreland left review comments
@AlexWaygood AlexWaygood Awaiting requested review from AlexWaygood AlexWaygood is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review docs Documentation in the Doc dir

Projects

Docs PRs
Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@srittau @StanFromIreland @JelleZijlstra @sobolevn
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.