mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
[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:
parent
5b27e6f64b
commit
0c198b85a3
5 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue