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

support decorator without () #191

Closed
superstar54 opened this issue Jul 30, 2024 · 0 comments · Fixed by #199
Closed

support decorator without () #191

superstar54 opened this issue Jul 30, 2024 · 0 comments · Fixed by #199
Assignees
Labels
enhancement New feature or request

Comments

@superstar54
Copy link
Member

Current, user need write () even though there is not input arguments for the decorator:

@task()
def add(x, y):
    return x+y

We should also support the decorator without parentheses, for example:

@task
def add(x, y):
    return x+y
@task.calcfunction
def add(x, y):
    return x+y
@superstar54 superstar54 added the enhancement New feature or request label Jul 30, 2024
@agoscinski agoscinski self-assigned this Jul 31, 2024
agoscinski added a commit that referenced this issue Aug 5, 2024
The decorators that could be used as

@decorator()
def add(x, y):
    return x+y

can now be used nonfunctional

@decorator
def add(x, y):
    return x+y

Implements feature request in issue #191
agoscinski added a commit that referenced this issue Aug 5, 2024
The decorators that could be used as

@decorator_factory()
def add(x, y):
    return x+y

can now be used nonfunctional

@decorator_factory
def add(x, y):
    return x+y

Implements feature request in issue #191
@superstar54 superstar54 linked a pull request Aug 6, 2024 that will close this issue
agoscinski added a commit that referenced this issue Aug 9, 2024
The decorators that could be used as

@decorator_factory()
def add(x, y):
    return x+y

can now be used nonfunctional

@decorator_factory
def add(x, y):
    return x+y

    Implements feature request in issue #191
agoscinski added a commit that referenced this issue Aug 9, 2024
The decorators that could be used as

@decorator_factory()
def add(x, y):
    return x+y

can now be used nonfunctional

@decorator_factory
def add(x, y):
    return x+y

    Implements feature request in issue #191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants