Skip to content

stubgen: use PEP 604 unions everywhere#16519

Merged
JelleZijlstra merged 1 commit intopython:masterfrom
hamdanal:stubgen-pep604
Jan 13, 2024
Merged

stubgen: use PEP 604 unions everywhere#16519
JelleZijlstra merged 1 commit intopython:masterfrom
hamdanal:stubgen-pep604

Conversation

@hamdanal
Copy link
Copy Markdown
Collaborator

Fixes #12920

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

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

@JelleZijlstra JelleZijlstra merged commit e28925d into python:master Jan 13, 2024
@hamdanal hamdanal deleted the stubgen-pep604 branch January 13, 2024 16:02
@hamdanal
Copy link
Copy Markdown
Collaborator 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