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

stubgen: use PEP 604 unions everywhere #16519

Merged
merged 1 commit into from Jan 13, 2024

Conversation

hamdanal
Copy link
Contributor

Fixes #12920

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

parso (https://github.com/davidhalter/parso): typechecking got 16796.73x faster (10.4s -> 0.0s)
(Performance measurements are based on a single noisy sample)

anyio (https://github.com/agronholm/anyio): typechecking got 3.35x faster (16.7s -> 5.0s)
(Performance measurements are based on a single noisy sample)

discord.py (https://github.com/Rapptz/discord.py): typechecking got 1.07x slower (176.3s -> 189.2s)
(Performance measurements are based on a single noisy sample)

@hamdanal
Copy link
Contributor Author

typechecking got 16796.73x faster (10.4s -> 0.0s)

@JelleZijlstra JelleZijlstra merged commit e28925d into python:master Jan 13, 2024
18 checks passed
@hamdanal hamdanal deleted the stubgen-pep604 branch January 13, 2024 16:02
@hamdanal
Copy link
Contributor Author

hamdanal commented Jan 13, 2024

Thanks @JelleZijlstra. Seems like a test was added after I created the PR https://github.com/python/mypy/actions/runs/7513432949/job/20455178894 and it fails. I'll send a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stubgen: use X | Y / X | None instead of Union[X, Y] / Union[X, None]
2 participants