51 prev_index = None
52
53 def map_row(row):
54 return dict(((pk, getattr(row, pk)),))55
56 return {
57 'prev': map_row(rows[prev_index]) if prev_index is not None else None,
It is unnecessary to use a list
or tuple
literal within a call to tuple
, list
, set
, or dict
since there is a literal syntax for these types.