          )
          return DynamicRoute(url, name, True, initkwargs)
  
  
  class DynamicListRoute(object):
      def __new__(cls, url, name, initkwargs):
          warnings.warn(
              "`DynamicListRoute` is deprecated and will be removed in 3.10 in "
              "favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
              "`DynamicRoute(url, name, False, initkwargs)` instead.",
 
</s> remove class DynamicDetailRoute(object):
 </s> add class DynamicDetailRoute: </s> remove         return super(SerializerMetaclass, cls).__new__(cls, name, bases, attrs)
 </s> add         return super().__new__(cls, name, bases, attrs) </s> remove                 path = urlparse.urlparse(link.url).path
 </s> add                 path = parse.urlparse(link.url).path </s> remove             for name, value in six.iteritems(headers):
 </s> add             for name, value in headers.items(): </s> remove             path = urlparse.urlparse(link.url).path
 </s> add             path = parse.urlparse(link.url).path
class DynamicListRoute:
          )
          return DynamicRoute(url, name, True, initkwargs)
  
  
class DynamicListRoute:
      def __new__(cls, url, name, initkwargs):
          warnings.warn(
              "`DynamicListRoute` is deprecated and will be removed in 3.10 in "
              "favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
              "`DynamicRoute(url, name, False, initkwargs)` instead.",
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/routers.py