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

Param decorator without *args for a positional argument #142

Open
Jaymon opened this issue Sep 3, 2024 · 0 comments
Open

Param decorator without *args for a positional argument #142

Jaymon opened this issue Sep 3, 2024 · 0 comments

Comments

@Jaymon
Copy link
Owner

Jaymon commented Sep 3, 2024

I think the index should just default to -1, so this should work as expected:

@param(help="the first value")
@param(help="the second value")
def GET(self, one, two): pass

This could work with a little change when index is negative, a negative index would just trigger the insert to insert at len(args) + 1 + index.

l = []

l.insert(len(l) + 1 + -1, "one")
l.insert(len(l) + 1 + -1, "two")
print(l) # ["one", "two"]
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