summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2017-01-23 16:13:49 -0800
committerTim Graham <timograham@gmail.com>2017-01-23 19:14:43 -0500
commit783afda70ad55e39f268c953997ec0f92ba37aee (patch)
tree052f657bf515c8282e96de1fe96d87df978cf97e /django
parent706b30fc37f59f2211b78ceff24c4fcb680e8a5d (diff)
[1.11.x] Replaced dict() usage with dict literals.
Literals are faster and more idiomatic. Backport of 0d74c41981687598d3fa0a7eb9712ce4c387ca19 from master
Diffstat (limited to 'django')
-rw-r--r--django/forms/widgets.py20
-rw-r--r--django/test/runner.py10
2 files changed, 15 insertions, 15 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 0a170b0118..f50ddd52ba 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -608,16 +608,16 @@ class ChoiceWidget(Widget):
option_attrs.update(self.checked_attribute)
if 'id' in option_attrs:
option_attrs['id'] = self.id_for_label(option_attrs['id'], index)
- return dict(
- name=name,
- value=value,
- label=label,
- selected=selected,
- index=index,
- attrs=option_attrs,
- type=self.input_type,
- template_name=self.option_template_name,
- )
+ return {
+ 'name': name,
+ 'value': value,
+ 'label': label,
+ 'selected': selected,
+ 'index': index,
+ 'attrs': option_attrs,
+ 'type': self.input_type,
+ 'template_name': self.option_template_name,
+ }
def get_context(self, name, value, attrs=None):
context = super(ChoiceWidget, self).get_context(name, value, attrs)
diff --git a/django/test/runner.py b/django/test/runner.py
index 487ec7c682..4dc8eb97f7 100644
--- a/django/test/runner.py
+++ b/django/test/runner.py
@@ -550,11 +550,11 @@ class DiscoverRunner(object):
return DebugSQLTextTestResult if self.debug_sql else None
def get_test_runner_kwargs(self):
- return dict(
- failfast=self.failfast,
- resultclass=self.get_resultclass(),
- verbosity=self.verbosity,
- )
+ return {
+ 'failfast': self.failfast,
+ 'resultclass': self.get_resultclass(),
+ 'verbosity': self.verbosity,
+ }
def run_checks(self):
# Checks are run after database creation since some checks require