use repr (instead of str) to print rql in __repr__ method of a result set
authorStephanie Marcu <stephanie.marcu@logilab.fr>
Tue, 02 Dec 2008 17:46:44 +0100
changeset 170 455ff18ef28e
parent 166 879d78d37d47
child 172 bed4bc2e0a2f
use repr (instead of str) to print rql in __repr__ method of a result set
rset.py
--- a/rset.py	Tue Dec 02 16:26:52 2008 +0100
+++ b/rset.py	Tue Dec 02 17:46:44 2008 +0100
@@ -59,10 +59,10 @@
     
     def __repr__(self):
         if not self.rows:
-            return '<empty resultset for %s>' % self.rql
+            return '<empty resultset for %r>' % self.rql
         if not self.description:
-            return '<resultset %s: %s>' % (self.rql, '\n'.join(str(r) for r in self.rows))
-        return '<resultset %s: %s>' % (self.rql,
+            return '<resultset %r: %s>' % (self.rql, '\n'.join(str(r) for r in self.rows))
+        return '<resultset %r: %s>' % (self.rql,
                                        '\n'.join('%s (%s)' % (r, d)
                                                  for r, d in zip(self.rows, self.description)))