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

change_func() method in jobs #599

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VictorioMaculan
Copy link

So, I created this exciting method, job().change_func(), because I think it would be cool to allow the users to change the job's function in a more implicit way, and, it also helps to keep the function metadata. Take a look:

def hello(name):
    print(f'Hello, {name}!')

sch = schedule.every().second.do(hello, 'folks')

while True:
    if timer >= 10:
        sch.change_func(hello, 'friends') # Right here
        
    schedule.run_pending()

But what do you guys think? Sorry for anything, it's my first time contributing :)

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

Successfully merging this pull request may close these issues.

None yet

1 participant