From 783afda70ad55e39f268c953997ec0f92ba37aee Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 23 Jan 2017 16:13:49 -0800 Subject: [1.11.x] Replaced dict() usage with dict literals. Literals are faster and more idiomatic. Backport of 0d74c41981687598d3fa0a7eb9712ce4c387ca19 from master --- django/forms/widgets.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'django/forms') 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) -- cgit v1.3