          if request.version is not None:
              kwargs = {} if (kwargs is None) else kwargs
              kwargs[self.version_param] = request.version
  
          return super(URLPathVersioning, self).reverse(
              viewname, args, kwargs, request, format, **extra
          )
  
  
  class NamespaceVersioning(BaseVersioning):
 
</s> remove         return super(NamespaceVersioning, self).reverse(
 </s> add         return super().reverse( </s> remove         url = super(QueryParameterVersioning, self).reverse(
 </s> add         url = super().reverse( </s> remove         super(DurationField, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs) </s> remove         class MockQueryset(object):
 </s> add         class MockQueryset: </s> remove         super(CharField, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs)
        return super().reverse(
          if request.version is not None:
              kwargs = {} if (kwargs is None) else kwargs
              kwargs[self.version_param] = request.version
  
        return super().reverse(
              viewname, args, kwargs, request, format, **extra
          )
  
  
  class NamespaceVersioning(BaseVersioning):
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