You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem here is that the type of [bar] is not "a list containing the module bar" but just "a list containing modules".
I believe we have seen other reports of this, but I can't recall specific issues. I think you can fix it by defining a Protocol representing the module's interface, and using that to declare the type of the list.
Activity
gvanrossum commentedon Dec 28, 2020
FWIW, the example consists of two files:
The problem here is that the type of
[bar]is not "a list containing the modulebar" but just "a list containing modules".I believe we have seen other reports of this, but I can't recall specific issues. I think you can fix it by defining a Protocol representing the module's interface, and using that to declare the type of the list.
aryansingla commentedon Dec 30, 2020
I want to contribute in it.
erictraut commentedon Aug 12, 2023
This bug appears to have been fixed. It no longer repros in mypy 1.5.