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 — Add breakpoint comments to version_info checks by donbarbos · Pull Request #642 · python/typing_extensions

Conversation

@donbarbos

@donbarbos donbarbos commented Aug 9, 2025

Copy link
Copy Markdown
Contributor

I believe that this change brings more clarity to code, and sys.version_info checks no longer use magic numbers (magic versions). Refinement of versions will help maintain some versions (maybe not necessarily by policy, but still nothing costs), otherwise we could get ImportError/AttributeError/"undefined behavior"

I just checked comment PRs according to 'Release Schedule' PEPs for 3.10, 3.11, 3.12, 3.13, 3.14 versions

Sorry, something went wrong.

Uh oh!

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

All reactions
@donbarbos
Refine version_info checks
8658a0e
AlexWaygood
AlexWaygood reviewed Aug 9, 2025
View reviewed changes
Comment thread src/typing_extensions.py Outdated
Comment on lines +173 to +174
# Breakpoint: https://github.com/python/cpython/pull/27342
if sys.version_info >= (3, 10, 0, "candidate"):

@AlexWaygood AlexWaygood Aug 9, 2025

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 like the comments you're adding to link to the CPython PRs, but I'd leave the sys.version_info conditions as they are unless we know of an actual problem that needs to be fixed here. This kind of change has caused significant breakage for users in the past in ways that were hard for us to anticipate ahead of time; it doesn't seem worth it to me to change anything here.

Sorry, something went wrong.

Uh oh!

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

All reactions

@donbarbos donbarbos Aug 9, 2025

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.

Sorry, but I’m not quite sure what kind of breakages could occur in this case, especially for sys.version_info checks before importing attributes. I’m having trouble imagining how this change might cause issues. Could you elaborate or give an example?

Sorry, something went wrong.

Uh oh!

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

All reactions

@AlexWaygood AlexWaygood Aug 9, 2025

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.

Sure, sorry for being vague! In #145, for example, I made it so that typing_extensions.Literal was no longer the same object as typing.Literal on Python <=3.9.0 (previously it had been the same object as typing.Literal on all Python versions >=3.8). Pydantic had internal code that incorrectly assumed that typing_extensions.Literal would always be the same object as typing.Literal on Python 3.8+, so this broke pydantic, causing a lot of disruption across the ecosystem and meaning we had to do a hotfix release of typing_extensions:

  • Cannot use Literal when I use typing-extension==4.6.0 pydantic/pydantic#5821
  • TypeError: issubclass() arg 1 must be a class with version 4.6.0 with pydantic #179
  • TypeError after upgrading version to 4.6.0 #182
  • Release 4.6.0 breaks Pydantic 1.9.2 #183

I don't think it's very likely that the specific changes you proposed here would cause that kind of breakage! But over the years of maintaining typing_extensions, I've come to realise that you really can't predict what kind of assumptions people are making about things like this -- I had no idea that change would break pydantic! So it's better not to make changes like this unless they're actually fixing something :-)

Sorry, something went wrong.

Uh oh!

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

donbarbos reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@donbarbos
leave conditions
ad11dc9
JelleZijlstra
JelleZijlstra approved these changes Aug 10, 2025
View reviewed changes
@donbarbos donbarbos changed the title Refine version_info checks Add breakpoint comments to version_info checks Aug 10, 2025
@AlexWaygood
AlexWaygood merged commit 5312ff7 into python:main Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood left review comments
@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

3 participants

@donbarbos @JelleZijlstra @AlexWaygood
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.