Skip to content

Instantly share code, notes, and snippets.

@alecthomas
Created November 12, 2013 15:34
Show Gist options
  • Save alecthomas/7432931 to your computer and use it in GitHub Desktop.
Save alecthomas/7432931 to your computer and use it in GitHub Desktop.
Python auto-import IDE assistance.
$ cat u.py
def f():
with suppress(IntegrityError):
print 'moo'
$ ./autoimporter u.py
from sqlalchemy.exc import IntegrityError
from contextlib import suppress
def f():
with suppress(IntegrityError):
print 'moo'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment