prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Remove the use of parsel.Selector._default_type
  Used at https://github.com/scrapy/scrapy/blob/58ca8bbf6d1589bd0c8cc1ebda52299346f55e8a/scrapy/selector/unified.py#L72
  
  We should stop relying on this private class variable unless there’s a good reason for it.
  
  [Noticed](https://github.com/scrapy/parsel/pull/181/files#r562118000) while trying out [JMESPath support for Parsel](https://github.com/scrapy/parsel/pull/181) in a real life project.
  
  </issue>
  <code>
  [start of scrapy/selector/unified.py]
  1 """
  2 XPath selectors based on lxml
  3 """
  4 
  5 from parsel import Selector as _ParselSelector
  6 from scrapy.utils.trackref import object_ref
  7 from scrapy.utils.python import to_bytes
  8 from scrapy.http import HtmlResponse, XmlResponse
  9 
  10 
  11 __all__ = ['Selector', 'SelectorList']
  12 
  13 
  14 def _st(response, st):
  15     if st is None:
  16         return 'xml' if isinstance(response, XmlResponse) else 'html'
  17     return st
  18 
  19 
  20 def _response_from_text(text, st):
  21     rt = XmlResponse if st == 'xml' else HtmlResponse
  22     return rt(url='about:blank', encoding='utf-8',
  23               body=to_bytes(text, 'utf-8'))
  24 
  25 
  26 class SelectorList(_ParselSelector.selectorlist_cls, object_ref):
  27     """
  28     The :class:`SelectorList` class is a subclass of the builtin ``list``
  29     class, which provides a few additional methods.
  30     """
  31 
  32 
  33 class Selector(_ParselSelector, object_ref):
  34     """
  35     An instance of :class:`Selector` is a wrapper over response to select
  36     certain parts of its content.
  37 
  38     ``response`` is an :class:`~scrapy.http.HtmlResponse` or an
  39     :class:`~scrapy.http.XmlResponse` object that will be used for selecting
  40     and extracting data.
  41 
  42     ``text`` is a unicode string or utf-8 encoded text for cases when a
  43     ``response`` isn't available. Using ``text`` and ``response`` together is
  44     undefined behavior.
  45 
  46     ``type`` defines the selector type, it can be ``"html"``, ``"xml"``
  47     or ``None`` (default).
  48 
  49     If ``type`` is ``None``, the selector automatically chooses the best type
  50     based on ``response`` type (see below), or defaults to ``"html"`` in case it
  51     is used together with ``text``.
  52 
  53     If ``type`` is ``None`` and a ``response`` is passed, the selector type is
  54     inferred from the response type as follows:
  55 
  56     * ``"html"`` for :class:`~scrapy.http.HtmlResponse` type
  57     * ``"xml"`` for :class:`~scrapy.http.XmlResponse` type
  58     * ``"html"`` for anything else
  59 
  60     Otherwise, if ``type`` is set, the selector type will be forced and no
  61     detection will occur.
  62     """
  63 
  64     __slots__ = ['response']
  65     selectorlist_cls = SelectorList
  66 
  67     def __init__(self, response=None, text=None, type=None, root=None, **kwargs):
  68         if response is not None and text is not None:
  69             raise ValueError(f'{self.__class__.__name__}.__init__() received '
  70                              'both response and text')
  71 
  72         st = _st(response, type or self._default_type)
  73 
  74         if text is not None:
  75             response = _response_from_text(text, st)
  76 
  77         if response is not None:
  78             text = response.text
  79             kwargs.setdefault('base_url', response.url)
  80 
  81         self.response = response
  82         super().__init__(text=text, type=st, root=root, **kwargs)
  83
  [end of scrapy/selector/unified.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/scrapy/selector/unified.py b/scrapy/selector/unified.py
  --- a/scrapy/selector/unified.py
  +++ b/scrapy/selector/unified.py
  @@ -69,7 +69,7 @@
               raise ValueError(f'{self.__class__.__name__}.__init__() received '
                                'both response and text')
   
  -        st = _st(response, type or self._default_type)
  +        st = _st(response, type)
   
           if text is not None:
               response = _response_from_text(text, st)
  
verification_info: {"golden_diff": "diff --git a/scrapy/selector/unified.py b/scrapy/selector/unified.py\n--- a/scrapy/selector/unified.py\n+++ b/scrapy/selector/unified.py\n@@ -69,7 +69,7 @@\n             raise ValueError(f'{self.__class__.__name__}.__init__() received '\n                              'both response and text')\n \n-        st = _st(response, type or self._default_type)\n+        st = _st(response, type)\n \n         if text is not None:\n             response = _response_from_text(text, st)\n", "issue": "Remove the use of parsel.Selector._default_type\nUsed at https://github.com/scrapy/scrapy/blob/58ca8bbf6d1589bd0c8cc1ebda52299346f55e8a/scrapy/selector/unified.py#L72\r\n\r\nWe should stop relying on this private class variable unless there\u2019s a good reason for it.\r\n\r\n[Noticed](https://github.com/scrapy/parsel/pull/181/files#r562118000) while trying out [JMESPath support for Parsel](https://github.com/scrapy/parsel/pull/181) in a real life project.\n", "before_files": [{"content": "\"\"\"\nXPath selectors based on lxml\n\"\"\"\n\nfrom parsel import Selector as _ParselSelector\nfrom scrapy.utils.trackref import object_ref\nfrom scrapy.utils.python import to_bytes\nfrom scrapy.http import HtmlResponse, XmlResponse\n\n\n__all__ = ['Selector', 'SelectorList']\n\n\ndef _st(response, st):\n    if st is None:\n        return 'xml' if isinstance(response, XmlResponse) else 'html'\n    return st\n\n\ndef _response_from_text(text, st):\n    rt = XmlResponse if st == 'xml' else HtmlResponse\n    return rt(url='about:blank', encoding='utf-8',\n              body=to_bytes(text, 'utf-8'))\n\n\nclass SelectorList(_ParselSelector.selectorlist_cls, object_ref):\n    \"\"\"\n    The :class:`SelectorList` class is a subclass of the builtin ``list``\n    class, which provides a few additional methods.\n    \"\"\"\n\n\nclass Selector(_ParselSelector, object_ref):\n    \"\"\"\n    An instance of :class:`Selector` is a wrapper over response to select\n    certain parts of its content.\n\n    ``response`` is an :class:`~scrapy.http.HtmlResponse` or an\n    :class:`~scrapy.http.XmlResponse` object that will be used for selecting\n    and extracting data.\n\n    ``text`` is a unicode string or utf-8 encoded text for cases when a\n    ``response`` isn't available. Using ``text`` and ``response`` together is\n    undefined behavior.\n\n    ``type`` defines the selector type, it can be ``\"html\"``, ``\"xml\"``\n    or ``None`` (default).\n\n    If ``type`` is ``None``, the selector automatically chooses the best type\n    based on ``response`` type (see below), or defaults to ``\"html\"`` in case it\n    is used together with ``text``.\n\n    If ``type`` is ``None`` and a ``response`` is passed, the selector type is\n    inferred from the response type as follows:\n\n    * ``\"html\"`` for :class:`~scrapy.http.HtmlResponse` type\n    * ``\"xml\"`` for :class:`~scrapy.http.XmlResponse` type\n    * ``\"html\"`` for anything else\n\n    Otherwise, if ``type`` is set, the selector type will be forced and no\n    detection will occur.\n    \"\"\"\n\n    __slots__ = ['response']\n    selectorlist_cls = SelectorList\n\n    def __init__(self, response=None, text=None, type=None, root=None, **kwargs):\n        if response is not None and text is not None:\n            raise ValueError(f'{self.__class__.__name__}.__init__() received '\n                             'both response and text')\n\n        st = _st(response, type or self._default_type)\n\n        if text is not None:\n            response = _response_from_text(text, st)\n\n        if response is not None:\n            text = response.text\n            kwargs.setdefault('base_url', response.url)\n\n        self.response = response\n        super().__init__(text=text, type=st, root=root, **kwargs)\n", "path": "scrapy/selector/unified.py"}]}