Annotate the code with type hint
busFred opened this issue · 1 comments
I am trying to add the adaptive particle swarm optimization algorithm to the library. However, the code in this library is not annotated with Python Type hint, which reduces the assistance that python linter can provide to users and developers. As a programmer who prefer to use C++, in which variables are strongly type, I strongly rely on the datatype information defined in function and class definition to write code.
Therefore, I suggest the library would be easier to use if it was annotated with python type hint according to PEP 484.
I could painfully live with the type information written in the docstring, but it would be better if type hint were used.
Without type hint, Visual Studio Code cannot tell the datatype of each input argument.
After things are annotated with type hint, Visual Studio Code can tell the expected datatype of each input argument. In addition, when user pass in unsupported datatype, the IDE will hint the user by adding a red underline below the line where potential TypeError could be raised.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.