Skip to content

pow float return value is Any in 0.950 #7733

Closed
@TylerYep

Description

@TylerYep

Bug Report

I upgraded to mypy 0.950 today and ran into the following error involving function return types:

To Reproduce

# x.py
def fn(x: float = 8.9) -> float:
    return 2 ** x    # error: Returning Any from function declared to return "float"  [no-any-return]

Expected Behavior

Expected this to pass cleanly.

Actual Behavior

I'm not sure why this now returns Any.

Your Environment

  • Mypy version used: 0.950
  • Mypy configuration options from mypy.ini (and other config files): strict = True
  • Python version used: Python 3.10.0
  • Operating system and version: Mac OSX

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