You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a [developer / user], I want [auto type checking] so that [coding is easier].
Details
I intend to add type hint to functions in a IronPython / Py2 compatible style as described in this very old file. Yes Py2 is old. But unfortunately to make things compatible, it is what it is.
The main idea is to add a # type: line immediately before docstring.
@property
def attached_tools(self):
# type: () -> dict[str, Tool]
"""Maps planning group to the tool attached to it."""
return self._attached_tools
I have been using this style for a while in my own repo. IronPython does not complain, Sphinx does not complain, PyLance in VS code grabs the type hint perfectly and enables certain autocomplete. I believe CoPilot uses this info too to make better suggestions.
I will probably start with the main classes like Robot and Tool.
The text was updated successfully, but these errors were encountered:
Feature Request
As a [developer / user], I want [auto type checking] so that [coding is easier].
Details
I intend to add type hint to functions in a IronPython / Py2 compatible style as described in this very old file. Yes Py2 is old. But unfortunately to make things compatible, it is what it is.
https://github.com/Sumindar/mypy/blob/95ab92015853fbdd3c83b081c470df92e8ca95c4/docs/source/cheat_sheet.rst
The main idea is to add a
# type:
line immediately before docstring.I have been using this style for a while in my own repo. IronPython does not complain, Sphinx does not complain, PyLance in VS code grabs the type hint perfectly and enables certain autocomplete. I believe CoPilot uses this info too to make better suggestions.
I will probably start with the main classes like Robot and Tool.
The text was updated successfully, but these errors were encountered: