Skip to content

Instantly share code, notes, and snippets.

@anacrolix
Created April 11, 2017 04:16
Show Gist options
  • Save anacrolix/92cf8c7e6d86ca905ff34d4c0a754bb1 to your computer and use it in GitHub Desktop.
Save anacrolix/92cf8c7e6d86ca905ff34d4c0a754bb1 to your computer and use it in GitHub Desktop.
class g:
def __init__(self):
self.s = "f"
def __call__(self, c=None):
if c is None:
self.s += "o"
return self
else:
return self.s+c
def f(c=None):
return g()(c)
print f('l')
print f()('l')
print f()()()()('l')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment