          if isinstance(instance, dict):
              attr = instance[field_name]
          else:
              attr = getattr(instance, field_name)
          return six.text_type(attr)
  
      def get_paginated_response(self, data):
          return Response(OrderedDict([
              ('next', self.get_next_link()),
              ('previous', self.get_previous_link()),
 
</s> remove     elif isinstance(value, six.string_types):
 </s> add     elif isinstance(value, str): </s> remove         super(Serializer, self).run_validators(to_validate)
 </s> add         super().run_validators(to_validate) </s> remove             if isinstance(urlconf, six.string_types):
 </s> add             if isinstance(urlconf, str): </s> remove                 kwargs = super(NestedPointSerializer, self).to_internal_value(data)
 </s> add                 kwargs = super().to_internal_value(data) </s> remove         super(URLPatternsTestCase, cls).tearDownClass()
 </s> add         super().tearDownClass()
        return str(attr)
          if isinstance(instance, dict):
              attr = instance[field_name]
          else:
              attr = getattr(instance, field_name)
        return str(attr)
  
      def get_paginated_response(self, data):
          return Response(OrderedDict([
              ('next', self.get_next_link()),
              ('previous', self.get_previous_link()),
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/pagination.py