Skip to content

Instantly share code, notes, and snippets.

@hamilyon
Created January 31, 2017 14:06
Show Gist options
  • Save hamilyon/1ef673c6f38147d73a6c7a37d3485d07 to your computer and use it in GitHub Desktop.
Save hamilyon/1ef673c6f38147d73a6c7a37d3485d07 to your computer and use it in GitHub Desktop.
from retry import retry
class Repeat:
def __init__(self, x, y, fn):
def repeated():
try:
fn(y)
except:
raise
self.call = retry(x)(repeated)
def __call__(self,):
return self.call()
pass
Repeat(2, "hello", print)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment