Skip to content

revealed type of 5 ** a is Any #8034

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

Closed
matejcik opened this issue Nov 29, 2019 · 1 comment
Closed

revealed type of 5 ** a is Any #8034

matejcik opened this issue Nov 29, 2019 · 1 comment

Comments

@matejcik
Copy link

The following code reproduces the problem both in 0.740 and current master. I run mypy with no options and no configuration.

a = 5
reveal_type(a)
reveal_type(5 ** 5)
reveal_type(5 ** a)

output:

% mypy mypy.py                                                                                                      
mypy.py:2: note: Revealed type is 'builtins.int'
mypy.py:3: note: Revealed type is 'builtins.int'
mypy.py:4: note: Revealed type is 'Any'
@JelleZijlstra
Copy link
Member

This is on purpose, see python/typeshed#1406 and python/typeshed#2662.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants