Skip to content

Instantly share code, notes, and snippets.

@agronholm
Created March 14, 2014 13:09
Show Gist options
  • Save agronholm/9547370 to your computer and use it in GitHub Desktop.
Save agronholm/9547370 to your computer and use it in GitHub Desktop.
class A:
@classmethod
def __enter__(cls): pass
@classmethod
def __exit__(cls, type, value, traceback): pass
with A:
pass
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: __exit__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment