Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
stubgen: Fix valid type detection to allow pipe unions#18726
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
b9745ef to9174c67CompareContributor
According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
ContributorAuthor
chadrik commentedFeb 24, 2025
@hamdanal@JelleZijlstra This is ready for review. |
JelleZijlstra approved these changesFeb 24, 2025
66dde14 intopython:master 19 checks passed
Uh oh!
There was an error while loading.Please reload this page.
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull requestFeb 24, 2025
<!-- If this pull request fixes an issue, add "Fixes #NNN" with theissue number. -->`stubgen` has a regex which it uses to reject invalid types that areextracted from docstrings. It needed to be updated to support unionshorthand: `str | int`.<!--Checklist:- Read the [ContributingGuidelines](https://github.com/python/mypy/blob/master/CONTRIBUTING.md)- Add tests for all changed behaviour.- If you can't add a test, please explain why and how you verified yourchanges work.- Make sure CI passes.- Please do not force push to the PR once it has been reviewed.-->
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
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.
stubgenhas a regex which it uses to reject invalid types that are extracted from docstrings. It needed to be updated to support union shorthand:str | int.