Calling next
over generic iterator inside list comprehension inside function call gives not callable error
#409
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
No error when calling
next
.Actual behaviour
I get an error that
next
is not callable.Code Snippet / Additional information
Pylance 2020.9.5 and older does not have this issue, just encountered it in 2020.9.6.
Maybe this is too specific of an issue, but just encountered this (the builtin
next
function gives error that it is not callable):On a simpler example (but not realistic, just to show the error):
The error is the same (that
next
is not callable) if I changeSomeProtocol
from aProtocol
to just someGeneric
class.If I fix the iterator type as e.g.
Iterator[int]
the problem disappears. If I remove the type ofarg
the error also goes away.Here is what I just said with
Iterator[int]
:It also disappears if
T
is resolved to some type:The text was updated successfully, but these errors were encountered: