-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Importing generic type aliases #2887
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
Comments
Looks like
|
Thanks for reporting this! Indeed, this looks like a bug. I will take a look at this. |
@ilevkivskyi Are you still working on this? |
Sorry, last weeks were busy, so I could not finish this. I actually wanted to spend next week less on reviewing PRs and more on fixing old assigned issues. Do you want to work on this one? |
I'm reviewing github issues and trying keep the information about who's working on what up-to-date. This issue isn't particularly urgent among the high-priority issues. |
Fixes #2887. Fixes #3191. In addition this prohibits reassigning aliases. Previously something like this was allowed: ``` if random(): Alias = Sequence[int] else: Alias = Sequence[float] def fun(arg: Alias) -> None: ... ``` Now this will generate an error: Cannot assign multiple types to name "Alias" without an explicit "Type[...]" annotation. See #3494 for background. Finally, this simplifies the logic in semanal.py, so that most processing of type aliases happens in one function.
lib.py
:main.py
:It works when an alias is defined in the same file
The text was updated successfully, but these errors were encountered: