Created
January 27, 2015 11:05
-
-
Save edenhill/b8c34d3fa3c7018ad63d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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