-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Refactor plugin system and special case TypedDict get and int.__pow__ #3501
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
Changes from 1 commit
0c03d3f
d82aa69
5661339
753d52c
166a911
b025991
2cf5cd7
abe29a9
8a240dc
e43d94a
6db7d20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1698,4 +1698,5 @@ reveal_type(a**(-0)) # E: Revealed type is 'builtins.int' | |
reveal_type(a**(-1)) # E: Revealed type is 'builtins.float' | ||
reveal_type(a**(-2)) # E: Revealed type is 'builtins.float' | ||
reveal_type(a**b) # E: Revealed type is 'Any' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At some point in the future I'd like mypy to do constant propagation too, so this would become int as well. :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, constant propagation for at least simple things like ints, floats and strings shouldn't be hard. Then we'd have to update this test case. |
||
reveal_type(a.__pow__(2)) # E: Revealed type is 'builtins.int' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try |
||
[builtins fixtures/ops.pyi] |
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.
The parentheses around the negative number are redundant; you can write
a**-2
. (Though it's nice to know that you handle parenthesized exponent too, since I presume users might not know the parentheses are redundant.)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'll remove most of the parentheses but keep one pair to ensure that they are accepted.