Bug: issubclass()
doesn't narrow TypeVar type with Protocol
#8556
Labels
false-positive
mypy gave an error on correct code
feature
priority-2-low
topic-type-narrowing
Conditional type narrowing / binder
topic-type-variables
Using issubclass with a runtime checkable Protocol and a union-bound TypeVar fails to narrow the type. The below example is from invoking mypy with
mypy --python-version=3.8 reproduce-issubclass-bug.py
. The issue seems similar to #7920. Tested on both 0.770 and master (0.770+dev.afe0667bbe85e048b6bb4e3fc1b7d5a375b7d01f).Output:
The text was updated successfully, but these errors were encountered: