
Kc           @   s   d  Z  d Z d d l m Z d e j f d     YZ d e f d     YZ d e f d	     YZ d
 e f d     YZ d e j f d     YZ	 d e	 f d     YZ
 d e e
 f d     YZ d S(   sL   Sequence Interfaces

$Id: sequence.py 110536 2010-04-06 02:59:44Z tseaver $
t   restructuredtexti(   t	   interfacet   IMinimalSequencec           B   s   e  Z d  Z d   Z RS(   s  Most basic sequence interface.

    All sequences are iterable.  This requires at least one of the
    following:

    - a `__getitem__()` method that takes a single argument; interger
      values starting at 0 must be supported, and `IndexError` should
      be raised for the first index for which there is no value, or

    - an `__iter__()` method that returns an iterator as defined in
      the Python documentation (http://docs.python.org/lib/typeiter.html).

    c         C   s   d S(   s   `x.__getitem__(index)` <==> `x[index]`

        Declaring this interface does not specify whether `__getitem__`
        supports slice objects.N(    (   t   index(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __getitem__$   s    (   t   __name__t
   __module__t   __doc__R   (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyR      s   t   IFiniteSequencec           B   s   e  Z d    Z RS(   c           C   s   d S(   s   `x.__len__()` <==> `len(x)`N(    (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __len__,   s    (   R   R   R	   (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyR   *   s   t   IReadSequencec           B   sq   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z RS(   s'   read interface shared by tuple and listc         C   s   d S(   s'   `x.__contains__(item)` <==> `item in x`N(    (   t   item(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __contains__2   s    c         C   s   d S(   s"   `x.__lt__(other)` <==> `x < other`N(    (   t   other(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __lt__5   s    c         C   s   d S(   s#   `x.__le__(other)` <==> `x <= other`N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __le__8   s    c         C   s   d S(   s#   `x.__eq__(other)` <==> `x == other`N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __eq__;   s    c         C   s   d S(   s#   `x.__ne__(other)` <==> `x != other`N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __ne__>   s    c         C   s   d S(   s"   `x.__gt__(other)` <==> `x > other`N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __gt__A   s    c         C   s   d S(   s#   `x.__ge__(other)` <==> `x >= other`N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __ge__D   s    c         C   s   d S(   s#   `x.__add__(other)` <==> `x + other`N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __add__G   s    c         C   s   d S(   s   `x.__mul__(n)` <==> `x * n`N(    (   t   n(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __mul__J   s    c         C   s   d S(   s   `x.__rmul__(n)` <==> `n * x`N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __rmul__M   s    c         C   s   d S(   s   `x.__getslice__(i, j)` <==> `x[i:j]`

        Use of negative indices is not supported.

        Deprecated since Python 2.0 but still a part of `UserList`.
        N(    (   t   it   j(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __getslice__P   s    (   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyR
   /   s   										t   IExtendedReadSequencec           B   s    e  Z d  Z d   Z d   Z RS(   s   Full read interface for listsc         C   s   d S(   s%   Return number of occurrences of valueN(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   count[   s    c         G   s   d S(   sQ   Return first index of value

        `L.index(value, [start, [stop]])` -> integerN(    (   R   t   args(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyR   ^   s    (   R   R   R   R   R   (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyR   X   s   	t   IUniqueMemberWriteSequencec           B   s   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d d	  Z
 d
   Z d   Z d d  Z d   Z RS(   sA   The write contract for a sequence that may enforce unique membersc         C   s   d S(   s   `x.__setitem__(index, item)` <==> `x[index] = item`

        Declaring this interface does not specify whether `__setitem__`
        supports slice objects.
        N(    (   R   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __setitem__f   s    c         C   s   d S(   s   `x.__delitem__(index)` <==> `del x[index]`

        Declaring this interface does not specify whether `__delitem__`
        supports slice objects.
        N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __delitem__m   s    c         C   s   d S(   s   `x.__setslice__(i, j, other)` <==> `x[i:j]=other`

        Use of negative indices is not supported.

        Deprecated since Python 2.0 but still a part of `UserList`.
        N(    (   R   R   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __setslice__t   s    c         C   s   d S(   s   `x.__delslice__(i, j)` <==> `del x[i:j]`

        Use of negative indices is not supported.

        Deprecated since Python 2.0 but still a part of `UserList`.
        N(    (   R   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __delslice__|   s    c         C   s   d S(   s   `x.__iadd__(y)` <==> `x += y`N(    (   t   y(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __iadd__   s    c         C   s   d S(   s   Append item to endN(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   append   s    c         C   s   d S(   s   Insert item before indexN(    (   R   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   insert   s    ic         C   s   d S(   s.   Remove and return item at index (default last)N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   pop   s    c         C   s   d S(   s    Remove first occurrence of valueN(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   remove   s    c           C   s   d S(   s   Reverse *IN PLACE*N(    (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   reverse   s    c         C   s   d S(   s3   Stable sort *IN PLACE*; `cmpfunc(x, y)` -> -1, 0, 1N(    (   t   cmpfunc(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   sort   s    c         C   s   d S(   s3   Extend list by appending elements from the iterableN(    (   t   iterable(    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   extend   s    N(   R   R   R   R   R    R!   R"   R$   R%   R&   R'   R(   R)   t   NoneR+   R-   (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyR   c   s   									t   IWriteSequencec           B   s   e  Z d  Z d   Z RS(   s!   Full write contract for sequencesc         C   s   d S(   s   `x.__imul__(n)` <==> `x *= n`N(    (   R   (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   __imul__   s    (   R   R   R   R0   (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyR/      s   t	   ISequencec           B   s   e  Z d  Z RS(   s   Full sequence contract(   R   R   R   (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyR1      s   N(   R   t   __docformat__t   zopeR   t	   InterfaceR   R   R
   R   R   R/   R1   (    (    (    sB   /usr/lib/python2.7/dist-packages/zope/interface/common/sequence.pyt   <module>   s   )8