Skip to content

Commit fccfdd2

Browse files
authored
Remove object inheritance in docs (#7332)
1 parent 8bb9a37 commit fccfdd2

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

docs/api-guide/fields.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ The `to_internal_value()` method is called to restore a primitive datatype into
603603

604604
Let's look at an example of serializing a class that represents an RGB color value:
605605

606-
class Color(object):
606+
class Color:
607607
"""
608608
A color represented in the RGB colorspace.
609609
"""

docs/api-guide/generic-views.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Often you'll want to use the existing generic views, but use some slightly custo
319319

320320
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:
321321

322-
class MultipleFieldLookupMixin(object):
322+
class MultipleFieldLookupMixin:
323323
"""
324324
Apply this mixin to any view or viewset to get multiple field filtering
325325
based on a `lookup_fields` attribute, instead of the default single field filtering.

docs/api-guide/serializers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Let's start by creating a simple object we can use for example purposes:
2121

2222
from datetime import datetime
2323

24-
class Comment(object):
24+
class Comment:
2525
def __init__(self, email, content, created=None):
2626
self.email = email
2727
self.content = content

docs/api-guide/validators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ to your `Serializer` subclass. This is documented in the
282282

283283
To write a class-based validator, use the `__call__` method. Class-based validators are useful as they allow you to parameterize and reuse behavior.
284284

285-
class MultipleOf(object):
285+
class MultipleOf:
286286
def __init__(self, base):
287287
self.base = base
288288

rest_framework/schemas/generators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def get_allowed_methods(self, callback):
143143
return [method for method in methods if method not in ('OPTIONS', 'HEAD')]
144144

145145

146-
class BaseSchemaGenerator(object):
146+
class BaseSchemaGenerator:
147147
endpoint_inspector_cls = EndpointEnumerator
148148

149149
# 'pk' isn't great as an externally exposed name for an identifier,

0 commit comments

Comments
 (0)