Instance variable with same name as class erroneously flagged as unbound #175
Labels
bug
Something isn't working
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
Expected behaviour
When I have a module with the following code:
no problems shall be listed.
Actual behaviour
A problem appears in the Problems tab, and squiggly lines are shown under the type of the
bar_
argument:"bar" is unbound Pylance (reportUnboundVariable)
Logs
Code Snippet / Additional information
One might think it would be rare that you would have a variable with the same name as a class, however, some packages like
datetime
has lowercase class names. In fact, I found this bug when I tried to name a variabledate
while I had imported thedate
class fromdatetime
.The text was updated successfully, but these errors were encountered: