Skip to content

Lambda with exponentiation return any warning #6210

Closed
@alanhdu

Description

@alanhdu

Using mypy 0.660 and Python 3.7, running mypy --warn-return-any on:

output = filter(lambda x: 2**x < 6, [1, 2, 3, 4])

returns

lambda.py:1: warning: Returning Any from function declared to return "object"

This only occurs when there's the exponentiation (**) in the lambda: if I change it to a + or *.

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