-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Generic type aliases #2378
Merged
Merged
Generic type aliases #2378
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5dc0090
Initial crude implementation of GA
f6d862b
Add support for Union, Tuple, Callable
ilevkivskyi b0790d4
Add runtime behaviour; outline tests
ilevkivskyi 7ddd6ab
Formatting + better types
ilevkivskyi 633e3d1
Add some tests
ilevkivskyi 07baa51
More tests, better error reporting
ilevkivskyi 56b7ae7
Add tests, comments, and doctrings
ilevkivskyi cbcb2c0
Add even more tests, add documentation
ilevkivskyi 5c92b12
Last tests
ilevkivskyi 13e1fff
Corrections due to upstream refactoring
ilevkivskyi ee1c25c
Add few more examples to docs
ilevkivskyi 2edcf48
Do not substitute type variables if they are in runtime expression, r…
ilevkivskyi 64fc96e
First part of response to comments (bigger things)
ilevkivskyi 8c64111
Update tests; some formatting
ilevkivskyi c106204
Second part of response to comments: minor things (but many); Two mor…
ilevkivskyi feb9413
Fix last bits
ilevkivskyi d402a68
Minor correction to docs
ilevkivskyi 8cea156
Yet another tiny correction to docs
ilevkivskyi 382c53e
Improving error messages (+column numbers); main part
ilevkivskyi 863c576
Remaining part of response to comments (minor thigs)
544ff66
Remove debugging print()
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like getting this twice. The first error is too vague since it doesn't tell you which position has the error.
(Unless you turn on column numbers? Which reminds me, it would be nice to turn on
--show-column-numbers
for at least some of the tests, to verify that they're being passed along.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gvanrossum OK, I updated the error messages, only the more detailed one is shown wherever possible.
Concerning the column numbers I discovered that a lot of code does not copy them. For example,
exprtotype.py
was simply throwing them away (I fixed this) while this file is the key, if column for a type is ignored here it is lost forever. I investigated this more and I found that this is a limitation of old parser and type comments. I don't know how to fix this (and think it will be difficult), but for fast parser and type annotations it is just one line and we get column for free.I used
--show-column-numbers
in two tests (one with old parser and one with fast parser). And indeed fast parser works better. So this is another argument to make the fast parser default.