Skip to content

Api-change: single before/after-call for non unique events#76

Merged
da-h merged 4 commits intomasterfrom
api-change_single_before_after_for_non-unique_events
Jul 30, 2021
Merged

Api-change: single before/after-call for non unique events#76
da-h merged 4 commits intomasterfrom
api-change_single_before_after_for_non-unique_events

Conversation

@da-h
Copy link
Copy Markdown
Owner

@da-h da-h commented Jul 30, 2021

This PR changes the way before_eventname/after_eventname events are called when using non-unique events.
Attention: This is a breaking change for events that assumed to wrap only single events to be wrapped.

Reason for this change is that the expected behavior for before/after events for a call such as event.event_to_call(...) is that they are called before/after that specific line once.

What this PR does:

  • rewrite the call to hook before/after events just once before/after a list of non-unique events are called
  • before events may transform args and kwargs just as for unique events
  • after events may transform the list of results of the whore non-unique event list
  • adaptions to the documentation to make this behavior clearer
  • added also a note to the documentation in register_event about the default event names init, main and final.

@da-h da-h requested a review from sbrodehl July 30, 2021 12:57
@da-h da-h changed the title Api change single before after for non unique events Api-change: single before after for non unique events Jul 30, 2021
@da-h da-h merged commit a5800be into master Jul 30, 2021
@da-h da-h deleted the api-change_single_before_after_for_non-unique_events branch July 30, 2021 13:00
@da-h da-h changed the title Api-change: single before after for non unique events Api-change: single before/after-call for non unique events Jul 30, 2021
github-actions Bot pushed a commit that referenced this pull request Jul 30, 2021
…on-unique_events

Api-change: single before after for non unique events
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.

2 participants