Skip to content

revealed type of 5 ** a is Any #8034

Closed
Closed

Description

@matejcik

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'

Activity

  1. JelleZijlstra commented on Nov 29, 2019

    @JelleZijlstra
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions