Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Add decorator to easily specify number of arguments #27

Closed
Guilherme-Vasconcelos opened this issue Jun 21, 2021 · 0 comments
Closed

Add decorator to easily specify number of arguments #27

Guilherme-Vasconcelos opened this issue Jun 21, 2021 · 0 comments

Comments

@Guilherme-Vasconcelos
Copy link
Owner

Guilherme-Vasconcelos commented Jun 21, 2021

Describe your idea
Instead of manually checking number of arguments in each function, add a decorator.

@num_args(0)
@authorize
def start(...):
    ...

Extra information
There are some edge cases:

  • Some functions require any number of arguments
  • However, some functions can accept a variable number of arguments but require a minimum (such as remindme, which requires at least 3)
  • Suggestion:
    • Omitting @num_args means any number of arguments
    • @num_args(X) means exactly X arguments
    • @min_num_args(X) means at least X arguments
    • @max_num_args(X) means at most X arguments
@Guilherme-Vasconcelos Guilherme-Vasconcelos self-assigned this Jun 21, 2021
@Guilherme-Vasconcelos Guilherme-Vasconcelos added this to To do in Issues via automation Jun 21, 2021
@Guilherme-Vasconcelos Guilherme-Vasconcelos moved this from To do to In progress in Issues Jun 21, 2021
@Guilherme-Vasconcelos Guilherme-Vasconcelos moved this from In progress to To do in Issues Jun 22, 2021
@Guilherme-Vasconcelos Guilherme-Vasconcelos moved this from To do to In progress in Issues Jun 24, 2021
Issues automation moved this from In progress to Done Jun 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

No branches or pull requests

1 participant