8000 Support for python 3.6 syntax (Static Type Checking) · Issue #3727 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

Support for python 3.6 syntax (Static Type Checking) #3727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
przemekgalazka opened this issue Apr 17, 2018 · 3 comments
Closed

Support for python 3.6 syntax (Static Type Checking) #3727

przemekgalazka opened this issue Apr 17, 2018 · 3 comments

Comments

@przemekgalazka
Copy link

Would be super cool to use Static Type Checking from the beginning as this may help a lot

https://medium.com/@ageitgey/learn-how-to-use-static-type-checking-in-python-3-6-in-10-minutes-12c86d72677b

@jpochyla
Copy link
Contributor
jpochyla commented Apr 18, 2018

MicroPython does support type hints for the function arguments, and for variables and instance properties you can use the comment syntax: # type: ....

As for possible run-time costs of import typing and such, I've ended up wrapping it in if __debug__: clauses.

@przemekgalazka
Copy link
Author
przemekgalazka commented Apr 19, 2018 via email

@dpgeorge
Copy link
Member

Is it hint or compile time error?

The compiler itself doesn't care about these type hints. You need to run an external tool (eg mypy) to find the type errors.

The addition of this particular syntax feature (PEP 526 - Syntax for Variable Annotations) is discussed in #2415, which also discusses other 3.6 changes. I'll close this issue for now.

jgillick pushed a commit to jgillick/micropython that referenced this issue Nov 24, 2020
esp32s2: Do a full scan when channel/BSSID are not given
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
30E5 Development

No branches or pull requests

3 participants
0