Skip to content

Instantly share code, notes, and snippets.

@dragonly
Created October 22, 2015 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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