diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index ce929fd4e4..f780b1cda0 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -94,7 +94,7 @@ class BaseDatabaseSchemaEditor(object): # Core utility functions - def execute(self, sql, params=[]): + def execute(self, sql, params=()): """ Executes the given SQL statement, with optional parameters. """ diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 5ff68b3d32..4017c9088b 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -142,7 +142,7 @@ class Field(RegisterLookupMixin): db_index=False, rel=None, default=NOT_PROVIDED, editable=True, serialize=True, unique_for_date=None, unique_for_month=None, unique_for_year=None, choices=None, help_text='', db_column=None, - db_tablespace=None, auto_created=False, validators=[], + db_tablespace=None, auto_created=False, validators=(), error_messages=None): self.name = name self.verbose_name = verbose_name # May be set by set_attributes_from_name @@ -175,7 +175,7 @@ class Field(RegisterLookupMixin): self.creation_counter = Field.creation_counter Field.creation_counter += 1 - self._validators = validators # Store for deconstruction later + self._validators = list(validators) # Store for deconstruction later messages = {} for c in reversed(self.__class__.__mro__): diff --git a/django/forms/fields.py b/django/forms/fields.py index 4a4b93b2b5..9f85f96dd0 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -62,7 +62,7 @@ class Field(object): def __init__(self, required=True, widget=None, label=None, initial=None, help_text='', error_messages=None, show_hidden_initial=False, - validators=[], localize=False, disabled=False, label_suffix=None): + validators=(), localize=False, disabled=False, label_suffix=None): # required -- Boolean that specifies whether the field is required. # True by default. # widget -- A Widget class, or instance of a Widget class, that should