Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 19054

Are variable type annotations useful everywhere?

$
0
0

For example:

def some_func(num: int) -> str:    var1: str = other_func(num)    var2: str = 'hi'    return var2 + var1

Is it OK to do annotations for inside variables (var1, var2) or are they redundant? Are there any conventions, or standards for such situations?


Viewing all articles
Browse latest Browse all 19054

Trending Articles



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