Skip to content

Fix required positional args#804

Open
Vipitis wants to merge 3 commits intopygfx:mainfrom
Vipitis:required-params
Open

Fix required positional args#804
Vipitis wants to merge 3 commits intopygfx:mainfrom
Vipitis:required-params

Conversation

@Vipitis
Copy link
Copy Markdown
Contributor

@Vipitis Vipitis commented Apr 6, 2026

fixes #803

I think this is a fix, but it is pretty awkward. The parsing logic for Attribute simply couldn't really distinguish between struct field (dict members) and positional args for a function. because the required <-> optional logic is different between the two.

Maybe there should be another class for Parameter instead?

I didn't check if any of the implementations of the native api need fixes, because some seem to validate defaults twice already example while the vast majority simply never handled an incorrectly passed None.

Python still won't necessarily raise anything more useful and the error comes from the native layer, unless you enforce typing.

@Vipitis Vipitis requested a review from Korijn as a code owner April 6, 2026 19:44
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.

some required positional arguments default to None

1 participant