      def __init__(self, view_name=None, **kwargs):
          assert view_name is not None, 'The `view_name` argument is required.'
          kwargs['read_only'] = True
          kwargs['source'] = '*'
          super(HyperlinkedIdentityField, self).__init__(view_name, **kwargs)
  
      def use_pk_only_optimization(self):
          # We have the complete object instance already. We don't need
          # to run the 'only get the pk for this relationship' code.
          return False
 
</s> remove         super(SlugRelatedField, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs) </s> remove         super(ManyRelatedField, self).__init__(*args, **kwargs)
 </s> add         super().__init__(*args, **kwargs) </s> remove @python_2_unicode_compatible
class PKOnlyObject(object):
 </s> add class PKOnlyObject: </s> remove         super(DictField, self).__init__(*args, **kwargs)
 </s> add         super().__init__(*args, **kwargs) </s> remove         return super(RelatedField, cls).__new__(cls, *args, **kwargs)
 </s> add         return super().__new__(cls, *args, **kwargs)
        super().__init__(view_name, **kwargs)
      def __init__(self, view_name=None, **kwargs):
          assert view_name is not None, 'The `view_name` argument is required.'
          kwargs['read_only'] = True
          kwargs['source'] = '*'
        super().__init__(view_name, **kwargs)
  
      def use_pk_only_optimization(self):
          # We have the complete object instance already. We don't need
          # to run the 'only get the pk for this relationship' code.
          return False
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/relations.py