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

Support match_args in cdef dataclasses #5381

Merged
merged 5 commits into from Nov 21, 2023

Conversation

da-woods
Copy link
Contributor

Part of #4303

This was originally supposed to go on top of #4989, but that's a pretty complicated PR while this is very simple and can be isolated so it may as well come first

for field_name, field in fields.items():
# TODO hasattr and global_kw_only can be removed once full kw_only support is added
field_is_kw_only = global_kw_only or (
hasattr(field, 'kw_only') and field.kw_only.value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This hasattr is only in to anticipate adding a kw_only attribute to field, so that it behaves correctly when that happens. Obviously when that does happen we won't need it.

It's a bit clunky, but it's just future-proofing, and can be removed later

@da-woods da-woods added this to the 3.1 milestone Nov 21, 2023
@da-woods da-woods merged commit 5c4ff00 into cython:master Nov 21, 2023
75 checks passed
@da-woods da-woods deleted the dataclasses_match_args_b branch November 21, 2023 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant