mypy strict not detecting booleans, returning 'no-any-return'

Viewed 301

For the following function

    def __eq__(self, other: object) -> bool:
        if not isinstance(other, Node):
            return False
        return other.address == self.address

mypy is reporting error: Returning Any from function declared to return "bool" [no-any-return] This seems strange, as it seems like both statements unambiguously return a boolean. Can anyone shed some light on this?

Thanks.

0 Answers
Related