1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Removed unnecessary tuple()/list() calls.

This commit is contained in:
Mads Jensen 2017-10-21 15:42:25 +02:00 committed by Tim Graham
parent 0f722d865e
commit 45d5d2dcaa
2 changed files with 5 additions and 5 deletions

View File

@ -520,11 +520,11 @@ def parse_accept_lang_header(lang_string):
result = []
pieces = accept_language_re.split(lang_string.lower())
if pieces[-1]:
return tuple()
return ()
for i in range(0, len(pieces) - 1, 3):
first, lang, priority = pieces[i:i + 3]
if first:
return tuple()
return ()
if priority:
priority = float(priority)
else:

View File

@ -127,11 +127,11 @@ class RasterFieldTest(TransactionTestCase):
stx_pnt = GEOSGeometry('POINT (-95.370401017314293 29.704867409475465)', 4326)
stx_pnt.transform(3086)
lookups = list(
lookups = [
(name, lookup)
for name, lookup in BaseSpatialField.get_lookups().items()
if issubclass(lookup, GISLookup)
)
]
self.assertNotEqual(lookups, [], 'No lookups found')
# Loop through all the GIS lookups.
for name, lookup in lookups:
@ -185,7 +185,7 @@ class RasterFieldTest(TransactionTestCase):
len(combo_values),
'Number of lookup names and values should be the same',
)
combos = list(x for x in zip(combo_keys, combo_values) if x[1])
combos = [x for x in zip(combo_keys, combo_values) if x[1]]
self.assertEqual(
[(n, x) for n, x in enumerate(combos) if x in combos[:n]],
[],