[py3] Replace filter/lambda by list comprehensions

This is more idiomatic and avoids returning a list on Python 2 and
an iterator on Python 3.
This commit is contained in:
Aymeric Augustin 2012-08-14 14:22:08 +02:00
parent 5b27e6f64b
commit 0c198b85a3
5 changed files with 6 additions and 5 deletions

View file

@ -1107,7 +1107,7 @@ class ValuesListQuerySet(ValuesQuerySet):
# If a field list has been specified, use it. Otherwise, use the
# full list of fields, including extras and aggregates.
if self._fields:
fields = list(self._fields) + filter(lambda f: f not in self._fields, aggregate_names)
fields = list(self._fields) + [f for f in aggregate_names if f not in self._fields]
else:
fields = names