      max_limit = None
      template = 'rest_framework/pagination/numbers.html'
  
      def paginate_queryset(self, queryset, request, view=None):
          self.count = _get_count(queryset)
          self.limit = self.get_limit(request)
          if self.limit is None:
              return None
  
          self.offset = self.get_offset(request)
 
</s> remove def _get_count(queryset):
    """
    Determine an object count, supporting either querysets or regular lists.
    """
    try:
        return queryset.count()
    except (AttributeError, TypeError):
        return len(queryset)


 </s> add 
        self.count = self.get_count(queryset)
      max_limit = None
      template = 'rest_framework/pagination/numbers.html'
  
      def paginate_queryset(self, queryset, request, view=None):
        self.count = self.get_count(queryset)
          self.limit = self.get_limit(request)
          if self.limit is None:
              return None
  
          self.offset = self.get_offset(request)
keep keep keep keep replace keep keep keep keep keep
 Add LimitOffsetPagination.get_count to allow method override (#5846)

* Add LimitOffsetPagination.get_count to allow method override

* Format method docstring 
rest_framework/pagination.py