# HG changeset patch # User Julien Cristau # Date 1381322736 -7200 # Node ID 49a7392bb5b5aaffdf899c268b168a19f7c2a90f # Parent bae0caa8477a64a285aef1f381f1919e6e1b044a [rset] make sure rset.description is always a list It's more consistent, and avoids pylint warning "Instance of 'tuple' has no 'append' member" diff -r bae0caa8477a -r 49a7392bb5b5 rset.py --- a/rset.py Wed Oct 09 16:30:27 2013 +0200 +++ b/rset.py Wed Oct 09 14:45:36 2013 +0200 @@ -45,7 +45,7 @@ :param rql: the original RQL query string """ - def __init__(self, results, rql, args=None, description=(), rqlst=None): + def __init__(self, results, rql, args=None, description=None, rqlst=None): self.rows = results self.rowcount = results and len(results) or 0 # original query and arguments @@ -53,7 +53,7 @@ self.args = args # entity types for each cell (same shape as rows) # maybe discarded if specified when the query has been executed - self.description = description + self.description = description or [] # parsed syntax tree if rqlst is not None: rqlst.schema = None # reset schema in case of pyro transfert diff -r bae0caa8477a -r 49a7392bb5b5 server/test/unittest_querier.py --- a/server/test/unittest_querier.py Wed Oct 09 16:30:27 2013 +0200 +++ b/server/test/unittest_querier.py Wed Oct 09 14:45:36 2013 +0200 @@ -702,7 +702,7 @@ rset = self.execute('Any X WHERE X is CWGroup', build_descr=0) rset.rows.sort() self.assertEqual(tuplify(rset.rows), [(2,), (3,), (4,), (5,)]) - self.assertEqual(rset.description, ()) + self.assertEqual(rset.description, []) def test_select_limit_offset(self): rset = self.execute('CWGroup X ORDERBY N LIMIT 2 WHERE X name N')