Skip to content

Instantly share code, notes, and snippets.

@datancoffee
Created April 23, 2024 10:49
Show Gist options
  • Save datancoffee/eb60390fcd4deda25feb42c4baa336ff to your computer and use it in GitHub Desktop.
Save datancoffee/eb60390fcd4deda25feb42c4baa336ff to your computer and use it in GitHub Desktop.
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