GitHub - davidmckayv/maybe: Python decorator that executes the function, maybe

· GitHub

1 min read Original article ↗

Latest commit

History

3 Commits

Folders and files

NameName

Last commit message

Last commit date

Repository files navigation

Python decorator that executes the function, maybe.

The idea is that some functions should randomly execute. This is implemented as a standard python decorator but using random.randint as a coin flip to decide whether or not the decorated function executes.

Example

@maybe
def say_hello():
    print("Hello!")


say_hello()

About

Python decorator that executes the function, maybe

Resources

Readme

BSD-3-Clause license

Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks

Releases

Packages

Contributors

Languages