Skip to content
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

Wifi typing fixes #5943

Merged
merged 2 commits into from
Jan 29, 2022
Merged

Wifi typing fixes #5943

merged 2 commits into from
Jan 29, 2022

Conversation

prplz
Copy link

@prplz prplz commented Jan 29, 2022

Fixes a couple of return type annotations in wifi.Radio

  • connect returns None, not bool
  • ping returns None when it times out

Copy link
Member

@anecdata anecdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed they do, by inspection and test. LGTM.

Adafruit CircuitPython 7.2.0-alpha.1-224-gac7a80753 on 2022-01-26; Saola 1 w/Wrover with ESP32S2
>>> import wifi
>>> from secrets import secrets
>>> 
>>> r = wifi.radio.connect(secrets['ssid'], secrets['password'])
>>> r
>>> type(r)
<class 'NoneType'>
>>> 
>>> while True:
...     print(type(p := wifi.radio.ping(wifi.radio.ipv4_gateway)), end=" ")
...     if not p:
...         print()
...         break
... 
<class 'float'> <class 'float'> <class 'NoneType'>
>>> 

@ladyada ladyada merged commit f4872d3 into adafruit:main Jan 29, 2022
@ladyada
Copy link
Member

ladyada commented Jan 29, 2022

trustin anecdata on this one, seems right to me too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants