Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 98994

Microsoft Python language server not recognizing `for` loop over `zip()`

$
0
0

In the following mwe visual studio code seems to be unable to realize the type. Using mouse-over shows the type of testa as str and testb as float which is correct. Using mouse-over on aelem or belem no type is recognized. I wonder why.

import typing
def MWE(a: typing.List[str], b: typing.List[float]) -> None:
    testa=a[0]
    testb=b[0]
    print(f"{testa} und {testb}")
    for aelem, belem in zip(a,b):
        aelem.rfind("/")
        round(belem)
MWE(['a','b'], [1.0,2.0])

Viewing all articles
Browse latest Browse all 98994

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>