Skip to content

Exponential operator results in typing.Any type #12073

Closed
@isaacto

Description

@isaacto

Bug Report

A regression: in the current version of mypy, float exponential results in typing.Any. For int exponential it works, only float exponential fails.

(A clear and concise description of what the bug is.)

To Reproduce

$ cat test.py
reveal_type(2.0 ** 1.0)

Expected Behavior

It should say that the revealed type is builtins.float when run.

Actual Behavior

$ mypy test.py
test.py:1: note: Revealed type is "Any"

Your Environment

  • Mypy version used: 0.931
  • Mypy command-line flags: Nothing special.
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.9.5
  • Operating system and version: Ubuntu 20.04.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions