Change before_event, after_event signature to be more pythonic #354
Vitalium
started this conversation in
Feature Request
Replies: 3 comments
-
Hey! This sounds reasonable. I'll try to add this today. Thank you |
Beta Was this translation helpful? Give feedback.
0 replies
-
Implemented in |
Beta Was this translation helpful? Give feedback.
0 replies
-
👍 Great job! Thank you for taking into account. By the way, typing hint for starred positional arguments can be as simple as the type of tuple entries ( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
My proposal is to change signature of functions
{before,after}_event
from:def before_event(event_types: Union[List[EventTypes], EventTypes]):
to:
def before_event(*event_types: EventTypes):
@before_event([Insert, Update])
vs@before_event(Insert, Update)
It looks more elegant and "pythonic" in both source and client code.
Beta Was this translation helpful? Give feedback.
All reactions