Created
April 23, 2024 10:49
-
-
Save datancoffee/eb60390fcd4deda25feb42c4baa336ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any | |
class Action: | |
def __init__(self, actionname: str = None): | |
if actionname is not None: | |
self.actionname = actionname | |
else: | |
self.actionname = "UnnamedAction" | |
def do(self,*args:Any, **kwargs: Any): | |
pass | |
# ThisAction(params) or ThisAction.do(params) | |
def __call__(self,*args:Any, **kwargs: Any): | |
return self.do(*args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment