;ò
ìŒü?c           @   sR   d  Z  d e d „ Z e Z d e d „ Z e Z d e d „ Z d e d „ Z d S(   s   Bisection algorithms.i    c         C   sy   | t j o t |  ƒ } n xE | | j  o7 | | d } | |  | j  o
 | } q  | d } q  W|  i | | ƒ d S(   sï   Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the right of the rightmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    i   i   N(   s   his   Nones   lens   as   los   mids   xs   insert(   s   as   xs   los   his   mid(    (    s#   /mit/python/lib/python2.3/bisect.pys   insort_right   s       
c         C   sm   | t j o t |  ƒ } n xE | | j  o7 | | d } | |  | j  o
 | } q  | d } q  W| Sd S(   sr  Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e <= x, and all e in
    a[i:] have e > x.  So if x already appears in the list, i points just
    beyond the rightmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    i   i   N(   s   his   Nones   lens   as   los   mids   x(   s   as   xs   los   his   mid(    (    s#   /mit/python/lib/python2.3/bisect.pys   bisect_right   s    	   
c         C   sy   | t j o t |  ƒ } n xE | | j  o7 | | d } |  | | j  o | d } q  | } q  W|  i | | ƒ d S(   sí   Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the left of the leftmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    i   i   N(   s   his   Nones   lens   as   los   mids   xs   insert(   s   as   xs   los   his   mid(    (    s#   /mit/python/lib/python2.3/bisect.pys   insort_left+   s       c         C   sm   | t j o t |  ƒ } n xE | | j  o7 | | d } |  | | j  o | d } q  | } q  W| Sd S(   sq  Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e < x, and all e in
    a[i:] have e >= x.  So if x already appears in the list, i points just
    before the leftmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    i   i   N(   s   his   Nones   lens   as   los   mids   x(   s   as   xs   los   his   mid(    (    s#   /mit/python/lib/python2.3/bisect.pys   bisect_left=   s    	   N(   s   __doc__s   Nones   insort_rights   insorts   bisect_rights   bisects   insort_lefts   bisect_left(   s   insort_rights   bisects   bisect_lefts   insorts   insort_lefts   bisect_right(    (    s#   /mit/python/lib/python2.3/bisect.pys   ?   s   