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

feature suggestion: accept MethodType and LambdaType #46

Open
Andrew-Wichmann opened this issue Sep 17, 2021 · 0 comments
Open

feature suggestion: accept MethodType and LambdaType #46

Andrew-Wichmann opened this issue Sep 17, 2021 · 0 comments

Comments

@Andrew-Wichmann
Copy link

There is an assertion that all functions of an action must be FunctionType. If a class method is provided, the error "'records' is not a list AssertionError " is thrown which is not the actual issue.

It would be nice if class methods were allowed to be part of an Action's "things to be called".

to replicate:

class MyClass():
  @classmethod
  def func(cls, arg1):
    pass

PATHS = {
    "PATH1": [
        Action(
            functions=[MyClass.func],
        )
    ],
}

suggestion

class MyClass():
  @classmethod
  def func(cls, arg1):
    pass

PATHS = {
    "PATH1": [
        Action(
            callables=[MyClass.func], // "callables" isn't a great name. Naming things is hard.
        )
    ],
}
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

No branches or pull requests

1 participant