Skip to content

False warning: Returning Any from function declared to return "bool" #5697

@stefanhoelzl

Description

@stefanhoelzl
  • Are you reporting a bug, or opening a feature request? Bugreport
  • Please insert below the code you are checking with mypy
from typing import Any

class Structure():
    def __eq__(self, other: Any) -> bool:
        return {} == other
  • What is the actual behavior/output?
mypytest.py:5: warning: Returning Any from function declared to return "bool"
  • What is the behavior/output you expect? No error
  • What are the versions of mypy and Python you are using?
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin

mypy==0.630

  • What are the mypy flags you are using?
    --strict

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