8000 super().__init__(*args, **kwargs) doesn't pass kwargs to parent C class. · Issue #15465 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
super().__init__(*args, **kwargs) doesn't pass kwargs to parent C class. #15465
Closed
@kwagyeman

Description

@kwagyeman

Port, board and/or hardware

openmv

MicroPython version

v1.23.0

Reproduction

See below.

Expected behaviour

There should be no error.

Observed behaviour

We have a class like this:

class Model(uml.Model):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

Its parent is a custom C class that implements make_new and accepts positional and keyword arguments.

When you pass just positional arguments to Model() in code using this subclass things work as expected. When you pass kwargs you get this error:

TypeError: function doesn't take keyword arguments

It appears MicroPython refuses to pass the kwargs to the parent class. Note that the error is not coming from code being executed in our make_new in C. It appears something else has rejected the kwargs being passed.

Additional Information

No response

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0