I am working through Mastering Matplotlib and in chapter two they introduce the following code snippet:
#! /usr/bin/env python3.4
import matplotlib.pyplot as plt
def main () -> None:
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.savefig('simple-line.png')
if __name__ == '__main__':
main()
This can be seen in this notebook, cell 10. I have never seen a main method defined this way, what is the function of -> None
?
My only thought so far is that this may be similar to def main(argv=None)
?
Beyond that, what is ->
in Python? I can't find it in this list of Python operators.