Skip to content

Instantly share code, notes, and snippets.

@dragonly
Created October 22, 2015 11:03
Show Gist options
  • Save dragonly/3444f13a39c4990392e9 to your computer and use it in GitHub Desktop.
Save dragonly/3444f13a39c4990392e9 to your computer and use it in GitHub Desktop.
class MyPrettyPrinter(pprint.PrettyPrinter):
def format(self, object, context, maxlevels, level):
if isinstance(object, unicode):
return (object.encode('utf8'), True, False)
return pprint.PrettyPrinter.format(self, object, context, maxlevels, level)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment