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

Fix annotated EventHandler #3076

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Fix annotated EventHandler #3076

merged 2 commits into from
Apr 11, 2024

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Apr 11, 2024

_GenericAlias is a private implementation detail, and when we attach the args_spec to it as an attribute, it seems to attach it to the class itself, and get overwritten every time the annotation is used.

Instead, reimplement this mechanism using the standard Annotated API, which is well supported since 3.9 and is designed for attaching extra information to a type hint.

Update the test cases for this feature to actually ensure the resulting args_spec is identical when defined via get_event_triggers.

masenf added 2 commits April 11, 2024 13:56
Ensure that the args_spec is attached to the __metadata__ in a supported way
@picklelo picklelo merged commit fc0be25 into main Apr 11, 2024
46 checks passed
@masenf masenf deleted the masenf/annotated-event-handler branch April 24, 2024 18:39
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.

3 participants