parameters: (value)
docstring: Override standard display hook to use non-locale encoding
docstring_summary: Override standard display hook to use non-locale encoding
docstring_tokens: Override standard display hook to use non - locale encoding
function: def displayhook(value):
      """Override standard display hook to use non-locale encoding"""
      if value is None:
          return
      # Set '_' to None to avoid recursion
      builtins._ = None
      text = repr(value)
      try:
          sys.stdout.write(text)
      except UnicodeEncodeError:
          # let's use ascii while utf8-bmp codec doesn't present
          encoding = 'ascii'
          bytes = text.encode(encoding, 'backslashreplace')
          text = bytes.decode(encoding, 'strict')
          sys.stdout.write(text)
      sys.stdout.write("\n")
      builtins._ = value
function_tokens: def displayhook ( value ) : if value is None : return # Set '_' to None to avoid recursion builtins . _ = None text = repr ( value ) try : sys . stdout . write ( text ) except UnicodeEncodeError : # let's use ascii while utf8-bmp codec doesn't present encoding = 'ascii' bytes = text . encode ( encoding , 'backslashreplace' ) text = bytes . decode ( encoding , 'strict' ) sys . stdout . write ( text ) sys . stdout . write ( "\n" ) builtins . _ = value