ó
^ęWc           @` sF   d  d l  m Z m Z m Z d  d l m Z d e f d     YZ d S(   i    (   t   absolute_importt   divisiont   unicode_literals(   t   Mappingt   Triec           B` s5   e  Z d  Z d d  Z d   Z d   Z d   Z RS(   u   Abstract base class for triesc         C` sQ   t    j   } | d  k r% t |  St g  | D] } | j |  r/ | ^ q/  S(   N(   t   supert   keyst   Nonet   sett
   startswith(   t   selft   prefixR   t   x(    (    sp   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/_vendor/html5lib/trie/_base.pyR   	   s    
c         C` s.   x' |  j    D] } | j |  r t Sq Wt S(   N(   R   R	   t   Truet   False(   R
   R   t   key(    (    sp   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/_vendor/html5lib/trie/_base.pyt   has_keys_with_prefix   s    c         C` s^   | |  k r | Sx; t  d t |  d  D]  } | |  |  k r* | |  Sq* Wt |   d  S(   Ni   (   t   ranget   lent   KeyError(   R
   R   t   i(    (    sp   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/_vendor/html5lib/trie/_base.pyt   longest_prefix   s     c         C` s   |  j  |  } | |  | f S(   N(   R   (   R
   R   t   lprefix(    (    sp   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/_vendor/html5lib/trie/_base.pyt   longest_prefix_item#   s    N(   t   __name__t
   __module__t   __doc__R   R   R   R   R   (    (    (    sp   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/_vendor/html5lib/trie/_base.pyR      s
   			
N(   t
   __future__R    R   R   t   collectionsR   R   (    (    (    sp   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/_vendor/html5lib/trie/_base.pyt   <module>   s   