Merged
Conversation
sobolevn
reviewed
Apr 24, 2025
test-data/unit/stubgen.test
Outdated
| alias: TypeAlias = tuple[int, str] | ||
|
|
||
| [out] | ||
| alias = tuple[int, str] |
Member
There was a problem hiding this comment.
I don't think that we should skip TypeAlias here. It should be like this, in my opinion:
Suggested change
| alias = tuple[int, str] | |
| from typing import TypeAlias | |
| alias: TypeAlias = tuple[int, str] |
sobolevn
reviewed
May 1, 2025
test-data/unit/stubgen.test
Outdated
| alias: TypeAlias = tuple[int, str] | ||
|
|
||
| [out] | ||
| alias: TypeAlias = tuple[int, str] |
Member
There was a problem hiding this comment.
Don't forget to add an import 👍
Contributor
Author
There was a problem hiding this comment.
@sobolevn sorry, this PR still WIP, I didn't mean to ask for a review
Member
There was a problem hiding this comment.
No worries, marked as a draft for now :)
…xplicit TypeAlias assignments
…name in import tracker
sobolevn
reviewed
May 1, 2025
mypy/stubgen.py
Outdated
| self.import_tracker.reexport(name) | ||
| as_name = name | ||
| import_names.append((name, as_name)) | ||
| # here's required = False |
Member
There was a problem hiding this comment.
Suggested change
| # here's required = False |
Contributor
Author
There was a problem hiding this comment.
fixed this, thank you
test-data/unit/stubgen.test
Outdated
| [case testExplicitTypeAlias] | ||
| from typing import TypeAlias | ||
|
|
||
| alias: TypeAlias = tuple[int, str] |
Member
There was a problem hiding this comment.
Suggested change
| alias: TypeAlias = tuple[int, str] | |
| explicit_alias: TypeAlias = tuple[int, str] | |
| implicit_alias = list[int] |
Contributor
Author
There was a problem hiding this comment.
fixed this, thank you
test-data/unit/stubgen.test
Outdated
| [out] | ||
| from typing import TypeAlias | ||
|
|
||
| alias: TypeAlias = tuple[int, str] |
Member
There was a problem hiding this comment.
Suggested change
| alias: TypeAlias = tuple[int, str] | |
| explicit_alias: TypeAlias = tuple[int, str] | |
| implicit_alias = list[int] |
Contributor
Author
There was a problem hiding this comment.
fixed this, thank you
…implicit_alias for clarity
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
Sign up for free
to 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.
fixes #18905
TypeAliasis an unanalyzed type, but is also an alias. So I changed a little bit of checking in thevisit_assignment_stmtmethod.