1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Eliminated lots of mutable default arguments (since they are bugs

waiting to happen and are memory leaks too).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3070 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant
2006-06-03 13:37:34 +00:00
parent 88d215f702
commit 9b86db9bf2
11 changed files with 92 additions and 44 deletions

View File

@@ -399,7 +399,8 @@ class AnyValidator:
as a validation error. The message is rather unspecific, so it's best to
specify one on instantiation.
"""
def __init__(self, validator_list=[], error_message=gettext_lazy("This field is invalid.")):
def __init__(self, validator_list=None, error_message=gettext_lazy("This field is invalid.")):
if validator_list is None: validator_list = []
self.validator_list = validator_list
self.error_message = error_message
for v in validator_list: