basedpyright
basedpyright copied to clipboard
`reportUnreachable` and `reportUnnecessaryComparison` false positive when comparing `TypeForm` to `None`
Description
Code sample in basedpyright playground
from typing_extensions import TypeForm
def foo(value: TypeForm[object]):
if value is None: # error: reportUnnecessaryComparison
print('hi') # error: reportUnreachable, reached at runtime
foo(None)
same with NoneType except only reportUnreachable is reported but not reportUnnecessaryComparison