diff options
| author | chillaranand <anand21nanda@gmail.com> | 2017-01-21 18:43:44 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-25 12:23:46 -0500 |
| commit | d6eaf7c0183cd04b78f2a55e1d60bb7e59598310 (patch) | |
| tree | ab02fd9949d4bfa23e27dea45e213ce334c883f0 /django/http | |
| parent | dc165ec8e5698ffc6dee6b510f1f92c9fd7467fe (diff) | |
Refs #23919 -- Replaced super(ClassName, self) with super().
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/cookie.py | 2 | ||||
| -rw-r--r-- | django/http/request.py | 20 | ||||
| -rw-r--r-- | django/http/response.py | 14 |
3 files changed, 18 insertions, 18 deletions
diff --git a/django/http/cookie.py b/django/http/cookie.py index 36945ce106..52dff786c4 100644 --- a/django/http/cookie.py +++ b/django/http/cookie.py @@ -14,7 +14,7 @@ else: # allow assignment of constructed Morsels (e.g. for pickling) dict.__setitem__(self, key, value) else: - super(SimpleCookie, self).__setitem__(key, value) + super().__setitem__(key, value) def parse_cookie(cookie): diff --git a/django/http/request.py b/django/http/request.py index bae0b6f3ec..c91a51b48d 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -363,7 +363,7 @@ class QueryDict(MultiValueDict): _encoding = None def __init__(self, query_string=None, mutable=False, encoding=None): - super(QueryDict, self).__init__() + super().__init__() if not encoding: encoding = settings.DEFAULT_CHARSET self.encoding = encoding @@ -415,11 +415,11 @@ class QueryDict(MultiValueDict): self._assert_mutable() key = bytes_to_text(key, self.encoding) value = bytes_to_text(value, self.encoding) - super(QueryDict, self).__setitem__(key, value) + super().__setitem__(key, value) def __delitem__(self, key): self._assert_mutable() - super(QueryDict, self).__delitem__(key) + super().__delitem__(key) def __copy__(self): result = self.__class__('', mutable=True, encoding=self.encoding) @@ -438,35 +438,35 @@ class QueryDict(MultiValueDict): self._assert_mutable() key = bytes_to_text(key, self.encoding) list_ = [bytes_to_text(elt, self.encoding) for elt in list_] - super(QueryDict, self).setlist(key, list_) + super().setlist(key, list_) def setlistdefault(self, key, default_list=None): self._assert_mutable() - return super(QueryDict, self).setlistdefault(key, default_list) + return super().setlistdefault(key, default_list) def appendlist(self, key, value): self._assert_mutable() key = bytes_to_text(key, self.encoding) value = bytes_to_text(value, self.encoding) - super(QueryDict, self).appendlist(key, value) + super().appendlist(key, value) def pop(self, key, *args): self._assert_mutable() - return super(QueryDict, self).pop(key, *args) + return super().pop(key, *args) def popitem(self): self._assert_mutable() - return super(QueryDict, self).popitem() + return super().popitem() def clear(self): self._assert_mutable() - super(QueryDict, self).clear() + super().clear() def setdefault(self, key, default=None): self._assert_mutable() key = bytes_to_text(key, self.encoding) default = bytes_to_text(default, self.encoding) - return super(QueryDict, self).setdefault(key, default) + return super().setdefault(key, default) def copy(self): """Returns a mutable copy of this object.""" diff --git a/django/http/response.py b/django/http/response.py index 9c697f5b88..244883a3aa 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -280,7 +280,7 @@ class HttpResponse(HttpResponseBase): streaming = False def __init__(self, content=b'', *args, **kwargs): - super(HttpResponse, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # Content is a bytestring. See the `content` property methods. self.content = content @@ -348,7 +348,7 @@ class StreamingHttpResponse(HttpResponseBase): streaming = True def __init__(self, streaming_content=(), *args, **kwargs): - super(StreamingHttpResponse, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # `streaming_content` should be an iterable of bytestrings. # See the `streaming_content` property methods. self.streaming_content = streaming_content @@ -396,14 +396,14 @@ class FileResponse(StreamingHttpResponse): value = iter(lambda: filelike.read(self.block_size), b'') else: self.file_to_stream = None - super(FileResponse, self)._set_streaming_content(value) + super()._set_streaming_content(value) class HttpResponseRedirectBase(HttpResponse): allowed_schemes = ['http', 'https', 'ftp'] def __init__(self, redirect_to, *args, **kwargs): - super(HttpResponseRedirectBase, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self['Location'] = iri_to_uri(redirect_to) parsed = urlparse(force_text(redirect_to)) if parsed.scheme and parsed.scheme not in self.allowed_schemes: @@ -432,7 +432,7 @@ class HttpResponseNotModified(HttpResponse): status_code = 304 def __init__(self, *args, **kwargs): - super(HttpResponseNotModified, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) del self['content-type'] @HttpResponse.content.setter @@ -458,7 +458,7 @@ class HttpResponseNotAllowed(HttpResponse): status_code = 405 def __init__(self, permitted_methods, *args, **kwargs): - super(HttpResponseNotAllowed, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self['Allow'] = ', '.join(permitted_methods) def __repr__(self): @@ -507,4 +507,4 @@ class JsonResponse(HttpResponse): json_dumps_params = {} kwargs.setdefault('content_type', 'application/json') data = json.dumps(data, cls=encoder, **json_dumps_params) - super(JsonResponse, self).__init__(content=data, **kwargs) + super().__init__(content=data, **kwargs) |
