Closed aatmdelissen closed 3 years ago
Haven't used it myself in Python yet, but I do think it helps the clarity of the code. Not sure if Sphinx can exploit this as well, but I assume those types will show up in the docs. That would make them quite helpful for others implementing their own classes etc.
I would be in favour of adding such annotations throughout the package
Agree! It will make the code more readable.
Since we all agree, let's do this! Please pinpoint to others when documentation and/or annotations are incorrect :)
Since we all agreed on this issue, I think we can close it
Type annotations in Python define the type of relevant arguments and return variables. It helps IDE's with type hints (you can see which type is expected). For more info, see https://realpython.com/lessons/annotations/