From 45d5d2dcaa72aa60a2ad2b8d7f0f299b8410b314 Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Sat, 21 Oct 2017 15:42:25 +0200 Subject: [PATCH] Removed unnecessary tuple()/list() calls. --- django/utils/translation/trans_real.py | 4 ++-- tests/gis_tests/rasterapp/test_rasterfield.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index 1b2472cc10..c640c42a37 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -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: diff --git a/tests/gis_tests/rasterapp/test_rasterfield.py b/tests/gis_tests/rasterapp/test_rasterfield.py index 710305fe62..cf64e8a82c 100644 --- a/tests/gis_tests/rasterapp/test_rasterfield.py +++ b/tests/gis_tests/rasterapp/test_rasterfield.py @@ -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]], [],