diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index 2d8a40dfc3..e06cc50fc8 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -865,8 +865,7 @@ class BaseDatabaseSchemaEditor: and a unique digest and suffix. """ _, table_name = split_identifier(table_name) - hash_data = [table_name] + list(column_names) - hash_suffix_part = '%s%s' % (self._digest(*hash_data), suffix) + hash_suffix_part = '%s%s' % (self._digest(table_name, *column_names), suffix) max_length = self.connection.ops.max_name_length() or 200 # If everything fits into max_length, use that name. index_name = '%s_%s_%s' % (table_name, '_'.join(column_names), hash_suffix_part) diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py index 28dc47f769..9520e890ea 100644 --- a/django/db/backends/mysql/introspection.py +++ b/django/db/backends/mysql/introspection.py @@ -85,22 +85,17 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): fields = [] for line in cursor.description: - col_name = line[0] - fields.append( - FieldInfo(*( - (col_name,) + - line[1:3] + - ( - to_int(field_info[col_name].max_len) or line[3], - to_int(field_info[col_name].num_prec) or line[4], - to_int(field_info[col_name].num_scale) or line[5], - line[6], - field_info[col_name].column_default, - field_info[col_name].extra, - field_info[col_name].is_unsigned, - ) - )) - ) + info = field_info[line[0]] + fields.append(FieldInfo( + *line[:3], + to_int(info.max_len) or line[3], + to_int(info.num_prec) or line[4], + to_int(info.num_scale) or line[5], + line[6], + info.column_default, + info.extra, + info.is_unsigned, + )) return fields def get_sequences(self, cursor, table_name, table_fields=()): diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py index dbd54c29be..f7ede7db13 100644 --- a/django/db/backends/oracle/introspection.py +++ b/django/db/backends/oracle/introspection.py @@ -84,13 +84,10 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): name = desc[0] internal_size, default, is_autofield = field_map[name] name = name % {} # cx_Oracle, for some reason, doubles percent signs. - description.append(FieldInfo(*( - (name.lower(),) + - desc[1:3] + - (internal_size, desc[4] or 0, desc[5] or 0) + - desc[6:] + - (default, is_autofield) - ))) + description.append(FieldInfo( + name.lower(), *desc[1:3], internal_size, desc[4] or 0, + desc[5] or 0, *desc[6:], default, is_autofield, + )) return description def table_name_converter(self, name): diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py index 30f764f2f0..859282057a 100644 --- a/django/db/backends/postgresql/introspection.py +++ b/django/db/backends/postgresql/introspection.py @@ -75,7 +75,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): field_map = {line[0]: line[1:] for line in cursor.fetchall()} cursor.execute("SELECT * FROM %s LIMIT 1" % self.connection.ops.quote_name(table_name)) return [ - FieldInfo(*(line[0:6] + (field_map[line.name][0] == 'YES', field_map[line.name][1]))) + FieldInfo(*line[0:6], field_map[line.name][0] == 'YES', field_map[line.name][1]) for line in cursor.description ] diff --git a/django/test/testcases.py b/django/test/testcases.py index 3496166124..58f1f20032 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -1056,7 +1056,7 @@ class CheckCondition: self.conditions = conditions def add_condition(self, condition, reason): - return self.__class__(*self.conditions + ((condition, reason),)) + return self.__class__(*self.conditions, (condition, reason)) def __get__(self, instance, cls=None): # Trigger access for all bases. diff --git a/django/utils/functional.py b/django/utils/functional.py index dcc8e87f77..0da1fffa2b 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -9,7 +9,7 @@ from functools import total_ordering, wraps # CPython) is a type and its instances don't bind. def curry(_curried_func, *args, **kwargs): def _curried(*moreargs, **morekwargs): - return _curried_func(*(args + moreargs), **{**kwargs, **morekwargs}) + return _curried_func(*args, *moreargs, **{**kwargs, **morekwargs}) return _curried