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

ESP32: getaddrinfo() does not conform to documentation #8039

Closed
karfas opened this issue Nov 27, 2021 · 3 comments
Closed

ESP32: getaddrinfo() does not conform to documentation #8039

karfas opened this issue Nov 27, 2021 · 3 comments

Comments

@karfas
Copy link

karfas commented Nov 27, 2021

Micropython v1.17, compiled with ESP-IDF v4.3

While trying #8038, I read the documentation of getaddrinfo() at https://docs.micropython.org/en/latest/library/socket.html?highlight=socket#socket.getaddrinfo

There I find

socket.getaddrinfo(host, port, af=0, type=0, proto=0, flags=0, /)

However, trying this at home gives me

>>> getaddrinfo('eris', 80, type=SOCK_DGRAM)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function doesn't take keyword arguments
@peterhinch
Copy link
Contributor

There are a number of MicroPython functions which only accept positional args.

@karfas
Copy link
Author

karfas commented Nov 27, 2021

@peterhinch: Maybe, but the documentation should at least mention that.
This is either wrong documented or wrong implemented (for me, it's a bug in both cases).

tannewt added a commit to tannewt/circuitpython that referenced this issue Jun 6, 2023
projectgus added a commit to projectgus/micropython that referenced this issue Jan 10, 2024
Closes micropython#8039.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
@dpgeorge
Copy link
Member

The documentation is correct. The / at the end of the argument list indicates that it accepts only positional arguments.

See https://peps.python.org/pep-0570/

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

Successfully merging a pull request may close this issue.

3 participants