Actually the displayhook should print the repr.
diff --git a/Lib/pdb.py b/Lib/pdb.py
index b00bbae..2f42b31 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -206,7 +206,7 @@
         """Custom displayhook for the exec in default(), which prevents
         assignment of the _ variable in the builtins.
         """
-        print obj
+        print repr(obj)
 
     def default(self, line):
         if line[:1] == '!': line = line[1:]