Skip to content

Mypy infers wrong type for -2 ** 0.5 #7046

Closed

Description

@JelleZijlstra

With current master of mypy and typeshed:

% mypy --custom-typeshed-dir . -c 'reveal_type((-2) ** 0.5)'
<string>:1: note: Revealed type is "builtins.float"

It's actually a complex.

This was brought up in python/mypy#12073 (comment) by @isaacto. cc @AlexWaygood who helped create our current stack of int.__pow__ overloads.

Activity

  1. added a commit that references this issue on Jan 27, 2022
    a9ca5ac
  2. added a commit that references this issue on Jan 27, 2022
    d5101dc
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