python 3.x what is -> annotation
<p>In the following snippet what is <code>-&gt;</code> operator ,does it indicate the return type of the function also is it mandatory to use it in python 3.x ? Please point me to few docs for the same</p>

<pre><code> def g() -&gt; str :
    ...
    return 'hello world'
</code></pre>

<p>This is type of return value: <a href="https://docs.python.org/3/library/typing.html" rel="nofollow">https://docs.python.org/3/library/typing.html</a> :) It's not mandatory, but might be usefull.</p>

python