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

namedtuple does not support "defaults" keyword argument #14303

Open
2 tasks done
ShadowLNC opened this issue Apr 14, 2024 · 0 comments
Open
2 tasks done

namedtuple does not support "defaults" keyword argument #14303

ShadowLNC opened this issue Apr 14, 2024 · 0 comments
Labels

Comments

@ShadowLNC
Copy link

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

Pico W (RP2040)

MicroPython version

MicroPython v1.22.2 on 2024-02-22; Raspberry Pi Pico W with RP2040

Reproduction

>>> from collections import namedtuple
>>> namedtuple('a', ['a'], defaults=[1])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function doesn't take keyword arguments

Expected behaviour

Expected the creation of a NamedTuple with defaults.

Observed behaviour

Exception as shown in repro code.

Additional Information

The keyword-only argument of defaults was added in Python 3.7 according to the Python docs. I could not find any mention of this change or disparity in the MicroPython docs.

I did, however, find that the change to other arguments becoming keyword-only in Python 3.6 is not listed as implemented in the MicroPython docs.

It seems like the lack of keyword argument support might be intentional - I'm not sure if this means it should be considered a feature request and/or docs improvement instead?

@ShadowLNC ShadowLNC added the bug label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant