-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working
Description
Describe the bug
Pyright believes that the type Module("typing") and the type types.ModuleType do not overlap. But that's not true: the object stored in a scope under the name typing due to the statement import typing is an instance of types.ModuleType. This leads to false-positive reportUnnecessaryComparison diagnostics.
Code or Screenshots
import types
import typing
def f(x: types.ModuleType):
if x is typing: # Condition will always evaluate to False since the types "ModuleType" and "Module("typing")" have no overlap (reportUnnecessaryComparison)
print("found typing")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working