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

[red-knot] Fallback for typing._NoDefaultType #14783

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Dec 5, 2024

Summary

typing_extensions has a >=3.13 re-export for the typing.NoDefault singleton, but not for typing._NoDefaultType. This causes problems as soon as we understand sys.version_info branches, so we explicity switch to typing._NoDefaultType for Python 3.13 and later.

This is a part of #14759 that I thought might make sense to break out and merge in isolation.

Test Plan

New test that will become more meaningful with #12700

`typing_extensions` has a `>=3.13` re-export for the `typing.NoDefault`
singleton, but not for `typing._NoDefaultType`. This causes problems as
soon as we understand `sys.version_info` branches, so we explicity
switch to `typing._NoDefaultType` for Python 3.13 and later.
@sharkdp sharkdp added the red-knot Multi-file analysis & type inference label Dec 5, 2024
@sharkdp sharkdp force-pushed the david/no-default-type-fallback branch from 9257ffa to ea2820a Compare December 5, 2024 08:09
Copy link
Contributor

github-actions bot commented Dec 5, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@sharkdp
Copy link
Contributor Author

sharkdp commented Dec 5, 2024

I'm merging this to decrease the diff in the statically-known branches PR. It seems relatively uncontroversial, but please let me know if something is off.

@sharkdp sharkdp merged commit 2d3f557 into main Dec 5, 2024
21 checks passed
@sharkdp sharkdp deleted the david/no-default-type-fallback branch December 5, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants