Skip to content

Instantly share code, notes, and snippets.

View chrlie's full-sized avatar

Charlie Liban chrlie

View GitHub Profile
@chrlie
chrlie / one_object.py
Created August 11, 2013 23:28
When is it appropriate to separate a context manager from the class it operates on?
class Bookshelf(object):
def __init__(self, *books):
self.books = books
self.browsing = False
def __enter__(self):
if self.browsing:
raise Exception('already browsing')
self.browsing = True
@chrlie
chrlie / keybase.md
Last active February 11, 2017 02:11

Keybase proof

I hereby claim:

  • I am chrlie on github.
  • I am chrlie (https://keybase.io/chrlie) on keybase.
  • I have a public key whose fingerprint is 4045 73E3 B3F3 6B53 03F3 2145 57D5 94A6 594A 29E5

To claim this, I am signing this object: