Conditional import of typing_extensions gives "Incompatible import" #9856
Closed
Description
When doing:
try:
from typing import Final
except ImportError:
from typing_extensions import Final
We get:
error: Incompatible import of "Final" (imported name has type "typing_extensions._SpecialForm", local name has type "typing._SpecialForm")
Unless I'm mistaken, this is a common pattern for supporting older Python versions. Therefore, it would ideally not trigger these errors, even if it has to be special cased.