summaryrefslogtreecommitdiff
path: root/django/forms
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:13:49 -0500
commit0d74c41981687598d3fa0a7eb9712ce4c387ca19 (patch)
tree2db025869993ceac6b7b92317e098bd6bb7ef35d /django/forms
parentd2e7d15b4c594f64ee9d37bf40e61920cea41487 (diff)
Replaced dict() usage with dict literals.
Literals are faster and more idiomatic.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/widgets.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 5e6eddaf91..71169d9618 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -593,16 +593,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)