From 59917d372437dadb47e4589e57a59181413eab58 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Wed, 13 May 2020 15:40:41 -0400 Subject: [PATCH 1/5] Remove unnecessary object class derive in docs --- docs/api-guide/serializers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index 87d3d4056a..4f566ff598 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -21,7 +21,7 @@ Let's start by creating a simple object we can use for example purposes: from datetime import datetime - class Comment(object): + class Comment: def __init__(self, email, content, created=None): self.email = email self.content = content From b247d9320be4401923df81de7f6ebca496b65bb9 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Wed, 13 May 2020 16:25:20 -0400 Subject: [PATCH 2/5] Remove unnecessary object derive --- rest_framework/schemas/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/schemas/generators.py b/rest_framework/schemas/generators.py index 4b6d82a149..77502d028b 100644 --- a/rest_framework/schemas/generators.py +++ b/rest_framework/schemas/generators.py @@ -143,7 +143,7 @@ def get_allowed_methods(self, callback): return [method for method in methods if method not in ('OPTIONS', 'HEAD')] -class BaseSchemaGenerator(object): +class BaseSchemaGenerator: endpoint_inspector_cls = EndpointEnumerator # 'pk' isn't great as an externally exposed name for an identifier, From 99e721cd35a9e71e02345e911324210443f3c3c6 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Wed, 13 May 2020 16:25:51 -0400 Subject: [PATCH 3/5] Remove unnecessary object derive --- docs/api-guide/validators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/validators.md b/docs/api-guide/validators.md index 009cd2468d..4451489d4d 100644 --- a/docs/api-guide/validators.md +++ b/docs/api-guide/validators.md @@ -282,7 +282,7 @@ to your `Serializer` subclass. This is documented in the To write a class-based validator, use the `__call__` method. Class-based validators are useful as they allow you to parameterize and reuse behavior. - class MultipleOf(object): + class MultipleOf: def __init__(self, base): self.base = base From bc2d8919f02d45d5fe5a245d3367b757fe2957cf Mon Sep 17 00:00:00 2001 From: johnthagen Date: Wed, 13 May 2020 16:26:15 -0400 Subject: [PATCH 4/5] Remove unnecessary object derive --- docs/api-guide/fields.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index 65c83b78e7..b2bdd50c8e 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -603,7 +603,7 @@ The `to_internal_value()` method is called to restore a primitive datatype into Let's look at an example of serializing a class that represents an RGB color value: - class Color(object): + class Color: """ A color represented in the RGB colorspace. """ From 083edb2918c00a0bffeff52a1ee84668a282837d Mon Sep 17 00:00:00 2001 From: johnthagen Date: Wed, 13 May 2020 16:26:34 -0400 Subject: [PATCH 5/5] Remove unnecessary object derive --- docs/api-guide/generic-views.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-guide/generic-views.md b/docs/api-guide/generic-views.md index a256eb2d96..4ff549f078 100644 --- a/docs/api-guide/generic-views.md +++ b/docs/api-guide/generic-views.md @@ -319,7 +319,7 @@ Often you'll want to use the existing generic views, but use some slightly custo For example, if you need to lookup objects based on multiple fields in the URL conf, you could create a mixin class like the following: - class MultipleFieldLookupMixin(object): + class MultipleFieldLookupMixin: """ Apply this mixin to any view or viewset to get multiple field filtering based on a `lookup_fields` attribute, instead of the default single field filtering.