Skip to content

Instantly share code, notes, and snippets.

View benjsto's full-sized avatar

Benjamin A. Stockwell benjsto

View GitHub Profile
@benjsto
benjsto / decorators.py
Created November 15, 2018 18:37
python decorators
def once(f):
def fn(*args, **kwargs):
if not fn.ran:
fn.ran = True
return f(*args, **kwargs)
print("Not calling again.")
fn.ran = False
return fn

Keybase proof

I hereby claim:

  • I am benjsto on github.
  • I am benjsto (https://keybase.io/benjsto) on keybase.
  • I have a public key whose fingerprint is 7E84 A9BF 1E88 6FC2 13E5 747A 0ED6 5747 B96E A539

To claim this, I am signing this object: