  
      def reverse(self, viewname, args=None, kwargs=None, request=None, format=None, **extra):
          if request.version is not None:
              viewname = self.get_versioned_viewname(viewname, request)
          return super(NamespaceVersioning, self).reverse(
              viewname, args, kwargs, request, format, **extra
          )
  
      def get_versioned_viewname(self, viewname, request):
          return request.version + ':' + viewname
 
</s> remove         url = super(QueryParameterVersioning, self).reverse(
 </s> add         url = super().reverse( </s> remove         return super(URLPathVersioning, self).reverse(
 </s> add         return super().reverse( </s> remove                 return super(CustomSearchFilter, self).get_search_fields(view, request)
 </s> add                 return super().get_search_fields(view, request) </s> remove                 "Invalid format '{0}'. Available formats are {1}. "
 </s> add                 "Invalid format '{}'. Available formats are {}. " </s> remove         value = six.text_type(data)
 </s> add         value = str(data)
        return super().reverse(
  
      def reverse(self, viewname, args=None, kwargs=None, request=None, format=None, **extra):
          if request.version is not None:
              viewname = self.get_versioned_viewname(viewname, request)
        return super().reverse(
              viewname, args, kwargs, request, format, **extra
          )
  
      def get_versioned_viewname(self, viewname, request):
          return request.version + ':' + viewname
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/versioning.py