-
Notifications
You must be signed in to change notification settings - Fork 107
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
Update network.pyi a bit #296
Conversation
@elmot Where did you get |
|
typehints/micropython/network.pyi
Outdated
|
||
import pyb | ||
|
||
@overload | ||
def country(code: str, /) -> NoReturn | str: | ||
def country(code: str, /) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not return value if a parameter is provided
>>> import network
>>> print(network.country())
XX
>>> print(network.country('FI'))
None
>>> print(network.country())
FI
>>>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If nothing is returned, then the return type is None
. NoReturn
means the function always raises an exception or aborts the program execution.
Fixes #241