  
  class DefaultSchema(ViewInspector):
      """Allows overriding AutoSchema using DEFAULT_SCHEMA_CLASS setting"""
      def __get__(self, instance, owner):
          result = super(DefaultSchema, self).__get__(instance, owner)
          if not isinstance(result, DefaultSchema):
              return result
  
          inspector_class = api_settings.DEFAULT_SCHEMA_CLASS
          assert issubclass(inspector_class, ViewInspector), (
 
</s> remove         class MockPager(object):
 </s> add         class MockPager: </s> remove         class DummyView(object):
 </s> add         class DummyView: </s> remove             key = six.text_type(key)
 </s> add             key = str(key) </s> remove         if isinstance(ret, six.text_type):
 </s> add         if isinstance(ret, str): </s> remove         assert isinstance(key, six.string_types)
 </s> add         assert isinstance(key, str)
        result = super().__get__(instance, owner)
  
  class DefaultSchema(ViewInspector):
      """Allows overriding AutoSchema using DEFAULT_SCHEMA_CLASS setting"""
      def __get__(self, instance, owner):
        result = super().__get__(instance, owner)
          if not isinstance(result, DefaultSchema):
              return result
  
          inspector_class = api_settings.DEFAULT_SCHEMA_CLASS
          assert issubclass(inspector_class, ViewInspector), (
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/schemas/inspectors.py