Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported left operand type for Callable in Union #13075

Closed
jolaf opened this issue Jul 5, 2022 · 1 comment
Closed

Unsupported left operand type for Callable in Union #13075

jolaf opened this issue Jul 5, 2022 · 1 comment
Labels
bug mypy got something wrong topic-pep-604 PEP 604 (union | operator)

Comments

@jolaf
Copy link
Contributor

jolaf commented Jul 5, 2022

The following code:

from collections.abc import Callable
from typing import Any

A = Callable[[Any], Any]
B = Callable[[Any, Any], Any]
C = A | B

produces the following output:

$ mypy test.py
test.py:6:5: error: Unsupported left operand type for | ("object")  [operator]
    C = A | B
        ^
Found 1 error in 1 file (checked 1 source file)

This looks like a false positive to me.

$ mypy --version
mypy 0.961 (compiled: yes)

$ python3 --version
Python 3.10.4

$ lsb_release -d
Description:	Ubuntu 22.04 LTS
@jolaf jolaf added the bug mypy got something wrong label Jul 5, 2022
@JelleZijlstra JelleZijlstra added the topic-pep-604 PEP 604 (union | operator) label Jul 5, 2022
@AlexWaygood
Copy link
Member

Duplicate of #12393

@AlexWaygood AlexWaygood marked this as a duplicate of #12393 Jul 5, 2022
@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-pep-604 PEP 604 (union | operator)
Projects
None yet
Development

No branches or pull requests

3 participants