From c913e7c950736ff44183544897fc375cde166dd3 Mon Sep 17 00:00:00 2001 From: Wouter Bolsterlee Date: Sun, 20 Mar 2016 22:31:49 +0100 Subject: Use list comprehension instead of calling map() ...which behaves differently on Python 3. --- happybase/table.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'happybase') diff --git a/happybase/table.py b/happybase/table.py index c0f2752..d4f490a 100644 --- a/happybase/table.py +++ b/happybase/table.py @@ -77,7 +77,7 @@ class Table(object): :rtype: list of dicts """ regions = self.connection.client.getTableRegions(self.name) - return map(thrift_type_to_dict, regions) + return [thrift_type_to_dict(r) for r in regions] # # Data retrieval @@ -210,10 +210,8 @@ class Table(object): cells = self.connection.client.getVerTs( self.name, row, column, timestamp, versions, {}) - if include_timestamp: - return map(make_cell_timestamp, cells) - else: - return map(make_cell, cells) + f = make_cell_timestamp if include_timestamp else make_cell + return [f(c) for c in cells] def scan(self, row_start=None, row_stop=None, row_prefix=None, columns=None, filter=None, timestamp=None, -- cgit v1.2.1