EuroPi icon indicating copy to clipboard operation
EuroPi copied to clipboard

[Project Suggestion] Add type hinting to firmware code

Open awonak opened this issue 3 years ago • 1 comments

Project Suggestion

MicroPython supports static type checking (at least up to Python version 3.6). The EuroPi firmware code should add type hinting to help improve static analysis and documentation for IDEs that support it.

Describe your suggestion or idea

By adding type hinting, this will make writing scripts easier by providing the expected type of parameters of the API.

There are no negative side effects for IDEs like Thonny that don't use it.

awonak avatar Jan 29 '22 18:01 awonak

Type hinting in micropython seems to be the wild west right now:

https://github.com/micropython/micropython-lib/issues/190

It looks like we would need to include a stubs library like https://pypi.org/project/micropython-typing/ if we wanted to support this. So I think that means we'l need to have a better handle on our packaging before we tackle this.

So I think this issue depends on #71

mjaskula avatar Feb 10 '22 17:02 mjaskula

Has type hinting improved since Feb. ? Function hinting at least seems to be supported.

pcurry avatar Oct 13 '22 16:10 pcurry

I haven’t looked into it since the 18 release.

mjaskula avatar Oct 15 '22 03:10 mjaskula

I think this has been open and unaddressed long enough that we can close it. If there is a renewed desire to take this on, we can reopen this issue.

awonak avatar Apr 08 '23 02:04 awonak