@@ -45,7 +45,7 @@ def __init__(self, *args, **kwargs):
4545 self .model_class = kwargs .pop ("model_class" , self .model_class )
4646 # this has no fields but assumptions are made elsewhere that self.fields exists.
4747 self .fields = {}
48- super (ResourceIdentifierObjectSerializer , self ).__init__ (* args , ** kwargs )
48+ super ().__init__ (* args , ** kwargs )
4949
5050 def to_representation (self , instance ):
5151 return {
@@ -69,15 +69,15 @@ def to_internal_value(self, data):
6969 self .fail ("incorrect_type" , data_type = type (data ["pk" ]).__name__ )
7070
7171
72- class SparseFieldsetsMixin ( object ) :
72+ class SparseFieldsetsMixin :
7373 """
7474 A serializer mixin that adds support for sparse fieldsets through `fields` query parameter.
7575
7676 Specification: https://jsonapi.org/format/#fetching-sparse-fieldsets
7777 """
7878
7979 def __init__ (self , * args , ** kwargs ):
80- super (SparseFieldsetsMixin , self ).__init__ (* args , ** kwargs )
80+ super ().__init__ (* args , ** kwargs )
8181 context = kwargs .get ("context" )
8282 request = context .get ("request" ) if context else None
8383
@@ -107,7 +107,7 @@ def __init__(self, *args, **kwargs):
107107 self .fields .pop (field_name )
108108
109109
110- class IncludedResourcesValidationMixin ( object ) :
110+ class IncludedResourcesValidationMixin :
111111 """
112112 A serializer mixin that adds validation of `include` query parameter to
113113 support compound documents.
@@ -150,7 +150,7 @@ def validate_path(serializer_class, field_path, path):
150150 this_serializer_class , included_field_path , included_field_name
151151 )
152152
153- super (IncludedResourcesValidationMixin , self ).__init__ (* args , ** kwargs )
153+ super ().__init__ (* args , ** kwargs )
154154
155155
156156class LazySerializersDict (Mapping ):
@@ -302,9 +302,7 @@ class PolymorphicSerializerMetaclass(SerializerMetaclass):
302302 """
303303
304304 def __new__ (cls , name , bases , attrs ):
305- new_class = super (PolymorphicSerializerMetaclass , cls ).__new__ (
306- cls , name , bases , attrs
307- )
305+ new_class = super ().__new__ (cls , name , bases , attrs )
308306
309307 # Ensure initialization is only performed for subclasses of PolymorphicModelSerializer
310308 # (excluding PolymorphicModelSerializer class itself).
@@ -363,7 +361,7 @@ def get_fields(self):
363361 raise Exception (
364362 "Cannot get fields from a polymorphic serializer given a queryset"
365363 )
366- return super (PolymorphicModelSerializer , self ).get_fields ()
364+ return super ().get_fields ()
367365
368366 @classmethod
369367 def get_polymorphic_serializer_for_instance (cls , instance ):
0 commit comments