<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -315,14 +315,29 @@ output to a string does not start with a newline.&quot;
 
 (defgeneric py-pprint-literal (stream kind value))
 
-(defmethod py-pprint-literal (stream (kind (eql :number)) (x integer))
+(defmethod py-pprint-literal :around (stream kind value)
+  (declare (ignore stream kind value))
   (with-standard-io-syntax
-    (format stream &quot;~D&quot; x)))
+    (call-next-method)))
+
+(defmethod py-pprint-literal (stream (kind (eql :number)) (x integer))
+  (format stream &quot;~D&quot; x))
 
 (defmethod py-pprint-literal (stream (kind (eql :number)) (x complex))
   (assert (= 0 (realpart x)))
-    (with-standard-io-syntax
-      (format stream &quot;~Gj&quot; (imagpart x))))
+  (format stream &quot;~Gj&quot; (imagpart x)))
+
+(defmethod py-pprint-literal (stream (kind (eql :number)) (x float))
+  (format stream &quot;~G&quot; x))
+
+(defmethod py-pprint-literal (stream (kind (eql :bytes)) (x vector))
+  (write-string &quot;b'&quot; stream)
+  (loop for item across x
+      do (when (characterp item)
+           (setf item (char-code item)))
+         (check-type item (unsigned-byte 8))
+         (format stream &quot;\\x~2,'0x&quot; item))
+  (write-string &quot;'&quot; stream))
 
 (defmethod py-pprint-literal (stream (kind (eql :string)) (x string))
   (multiple-value-bind (delim-quote other-quote unicode?)
@@ -334,59 +349,39 @@ output to a string does not start with a newline.&quot;
 			 (other-quote (if (char= delim-quote #\') #\&quot; #\'))
 			 (unicode? (&gt; unicode 0)))
 		    (return (values delim-quote other-quote unicode?))))
-    
-    (with-standard-io-syntax ;; no recursion please
-      
-      (when unicode? ;; unicode prefix 'u'
-	(write-char #\u stream))
-      
-      (write-char delim-quote stream) ;; starting quote
-      
-      (loop for ch of-type character across (the string x)
-	  do (cond ((char= ch delim-quote)  (write-char #\\ stream)
-					    (write-char ch stream))
-		   
-		   ((char= ch other-quote)  (write-char ch stream))
-		   
-		   ((char= ch #\\)  (write-char #\\ stream)
-				    (write-char #\\ stream))
-		   
-		   ;; printable ASCII character
-		   ((and (&lt;= (char-code ch) 127) 
-			 (graphic-char-p ch))     (write-char ch stream))
-		   
-		   ((&gt; (char-code ch) 255)
-		    (format stream &quot;\\u~v,vX&quot;
-			    (if (&gt; (char-code ch) #xFFFF) 8 4)
-			    #\0 (char-code ch)))
-		   
-		   ((alphanumericp ch)  (write-char ch stream))
-		   
-		   (t (loop for ch across
-                            ;; Cross-reference: #'(read-kind (string) ..) does the inverse.
-			    (case ch
-			      (#\Bell      &quot;\\a&quot;) 
-			      (#\Backspace &quot;\\b&quot;)
-			      (#\Page      &quot;\\p&quot;)
-			      (#\Newline   &quot;\\n&quot;)
-			      (#\Return    &quot;\\r&quot;)
-			      (#\Tab       &quot;\\t&quot;)
-			      (#.(code-char 11) &quot;\\v&quot;) ;; #\VT or #\PageUp
-			      (#\Space     &quot; &quot; )
-			      
-			      ;; Maybe there are more cases to catch before
-			      ;; we encode the character in octal code?
-			      
-			      (t (format nil &quot;\\0~3,vO&quot; #\0 (char-code ch))))
-			    
-			  do (write-char ch stream)))))
-      
-      (write-char delim-quote stream)))) ;; closing quote
-
-(defmethod py-pprint-literal (stream (kind (eql :number)) (x float))
-  (with-standard-io-syntax
-    (format stream &quot;~G&quot; x)))
-
+    (when unicode? ;; unicode prefix 'u'
+      (write-char #\u stream))
+    (write-char delim-quote stream) ;; starting quote
+    (loop for ch of-type character across (the string x)
+        do (cond ((char= ch delim-quote)  (write-char #\\ stream)
+                                          (write-char ch stream))
+                 ((char= ch other-quote)  (write-char ch stream))
+                 ((char= ch #\\)  (write-char #\\ stream)
+                                  (write-char #\\ stream))
+                 ;; printable ASCII character
+                 ((and (&lt;= (char-code ch) 127) 
+                       (graphic-char-p ch))     (write-char ch stream))
+		 ((&gt; (char-code ch) 255)
+                  (format stream &quot;\\u~v,vX&quot;
+                          (if (&gt; (char-code ch) #xFFFF) 8 4)
+                          #\0 (char-code ch)))
+		 ((alphanumericp ch)  (write-char ch stream))
+		 (t (loop for ch across
+                          ;; Cross-reference: #'(read-kind (string) ..) does the inverse.
+                          (case ch
+                            (#\Bell      &quot;\\a&quot;) 
+                            (#\Backspace &quot;\\b&quot;)
+                            (#\Page      &quot;\\p&quot;)
+                            (#\Newline   &quot;\\n&quot;)
+                            (#\Return    &quot;\\r&quot;)
+                            (#\Tab       &quot;\\t&quot;)
+                            (#.(code-char 11) &quot;\\v&quot;) ;; #\VT or #\PageUp
+                            (#\Space     &quot; &quot; )
+                            ;; Maybe there are more cases to catch before
+                            ;; we encode the character in octal code?
+                            (t (format nil &quot;\\0~3,vO&quot; #\0 (char-code ch))))
+                        do (write-char ch stream)))))
+    (write-char delim-quote stream))) ;; closing quote
 
 ;; Utils
 </diff>
      <filename>parser/pprint.lisp</filename>
    </modified>
    <modified>
      <diff>@@ -276,6 +276,8 @@ else:
       ;; string
       (pe &quot;'x'&quot;)
       (p &quot;'\&quot;'&quot;)
+      ;; bytes
+      (p &quot;b'\\x41\\x42\\x03'&quot;)
       ;; assert
       (p &quot;assert (1, 2, 3)&quot;)
       (p &quot;assert x &gt; 0, 'error'&quot;)
@@ -500,6 +502,7 @@ finally:
       (p &quot;(yield)&quot;)
       (p &quot;(yield x)&quot;)
       (p &quot;(yield x, y)&quot;)
+      (p &quot;()&quot;)
       )))
 
 (defun run-lispy-test ()</diff>
      <filename>test/parser-test.lisp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8297f48ce9132f6a00d454ff1f8f7ea8a5d20160</id>
    </parent>
  </parents>
  <author>
    <name>unknown</name>
    <email>Willem@.(none)</email>
  </author>
  <url>http://github.com/franzinc/cl-python/commit/ce88957263d3ee0d2ab817cc5342feea472b3bb5</url>
  <id>ce88957263d3ee0d2ab817cc5342feea472b3bb5</id>
  <committed-date>2009-11-02T15:56:05-08:00</committed-date>
  <authored-date>2009-10-24T21:58:07-07:00</authored-date>
  <message>Pretty-print literal bytes() in AST</message>
  <tree>1b7b0e6fd2bcbb1a6ce8be24f54203dd937ab319</tree>
  <committer>
    <name>Willem Broekema</name>
    <email>metawilm@gmail.com</email>
  </committer>
</commit>
