Skip to content

Instantly share code, notes, and snippets.

@edenhill
Created January 27, 2015 11:05
Show Gist options
  • Save edenhill/b8c34d3fa3c7018ad63d to your computer and use it in GitHub Desktop.
Save edenhill/b8c34d3fa3c7018ad63d to your computer and use it in GitHub Desktop.
#!/usr/bin/python
#
class Burton (object):
def __init__ (self):
self.foo = 1
def __enter__ (self):
return self
def __exit__ (self, t, v, tr):
return self
def render (vals):
fmt = 'a %i, or %d'
return fmt % vals
def render (vals):
fmt = 'a %i, or %d'
return fmt % vals
if __name__ == '__main__':
v = [1, 2]
r = render(tuple(v))
print r
with Burton() as b:
r2 = b.render(tuple(v))
print r2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment