
|W=                 @   s   d  Z  d Z d d l m Z Gd d   d e  Z Gd d   d e  Z Gd d	   d	 e  Z Gd
 d   d e  Z Gd d   d e  Z Gd d   d e  Z	 Gd d   d e e	  Z
 d S)zSequence Interfaces
Zrestructuredtext    )	Interfacec               @   s"   e  Z d  Z d Z d d   Z d S)IMinimalSequencea  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)z`x.__getitem__(index)` <==> `x[index]`

        Declaring this interface does not specify whether `__getitem__`
        supports slice objects.N )indexr   r   @/usr/lib/python3/dist-packages/zope/interface/common/sequence.py__getitem__"   s    zIMinimalSequence.__getitem__N)__name__
__module____qualname____doc__r   r   r   r   r   r      s   r   c               @   s   e  Z d  Z d d   Z d S)IFiniteSequencec               C   s   d S)z`x.__len__()` <==> `len(x)`Nr   r   r   r   r   __len__*   s    zIFiniteSequence.__len__N)r   r	   r
   r   r   r   r   r   r   (   s   r   c               @   s   e  Z d  Z d Z d d   Z d d   Z d d   Z d d	   Z d
 d   Z d d   Z	 d d   Z
 d d   Z d d   Z d d   Z d d   Z d S)IReadSequencez'read interface shared by tuple and listc             C   s   d S)z'`x.__contains__(item)` <==> `item in x`Nr   )itemr   r   r   __contains__0   s    zIReadSequence.__contains__c             C   s   d S)z"`x.__lt__(other)` <==> `x < other`Nr   )otherr   r   r   __lt__3   s    zIReadSequence.__lt__c             C   s   d S)z#`x.__le__(other)` <==> `x <= other`Nr   )r   r   r   r   __le__6   s    zIReadSequence.__le__c             C   s   d S)z#`x.__eq__(other)` <==> `x == other`Nr   )r   r   r   r   __eq__9   s    zIReadSequence.__eq__c             C   s   d S)z#`x.__ne__(other)` <==> `x != other`Nr   )r   r   r   r   __ne__<   s    zIReadSequence.__ne__c             C   s   d S)z"`x.__gt__(other)` <==> `x > other`Nr   )r   r   r   r   __gt__?   s    zIReadSequence.__gt__c             C   s   d S)z#`x.__ge__(other)` <==> `x >= other`Nr   )r   r   r   r   __ge__B   s    zIReadSequence.__ge__c             C   s   d S)z#`x.__add__(other)` <==> `x + other`Nr   )r   r   r   r   __add__E   s    zIReadSequence.__add__c             C   s   d S)z`x.__mul__(n)` <==> `x * n`Nr   )nr   r   r   __mul__H   s    zIReadSequence.__mul__c             C   s   d S)z`x.__rmul__(n)` <==> `n * x`Nr   )r   r   r   r   __rmul__K   s    zIReadSequence.__rmul__c             C   s   d S)z`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`.
        Nr   )ijr   r   r   __getslice__N   s    zIReadSequence.__getslice__N)r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   -   s   r   c               @   s.   e  Z d  Z d Z d d   Z d d   Z d S)IExtendedReadSequencezFull read interface for listsc             C   s   d S)z%Return number of occurrences of valueNr   )r   r   r   r   countY   s    zIExtendedReadSequence.countc             G   s   d S)zQReturn first index of value

        `L.index(value, [start, [stop]])` -> integerNr   )r   argsr   r   r   r   \   s    zIExtendedReadSequence.indexN)r   r	   r
   r   r    r   r   r   r   r   r   V   s   r   c               @   s   e  Z d  Z d Z d d   Z d d   Z d d   Z d d	   Z d
 d   Z d d   Z	 d d   Z
 d d d  Z d d   Z d d   Z d d d  Z d d   Z d S)IUniqueMemberWriteSequencezAThe write contract for a sequence that may enforce unique membersc             C   s   d S)z`x.__setitem__(index, item)` <==> `x[index] = item`

        Declaring this interface does not specify whether `__setitem__`
        supports slice objects.
        Nr   )r   r   r   r   r   __setitem__d   s    z&IUniqueMemberWriteSequence.__setitem__c             C   s   d S)z`x.__delitem__(index)` <==> `del x[index]`

        Declaring this interface does not specify whether `__delitem__`
        supports slice objects.
        Nr   )r   r   r   r   __delitem__k   s    z&IUniqueMemberWriteSequence.__delitem__c             C   s   d S)z`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`.
        Nr   )r   r   r   r   r   r   __setslice__r   s    z'IUniqueMemberWriteSequence.__setslice__c             C   s   d S)z`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`.
        Nr   )r   r   r   r   r   __delslice__z   s    z'IUniqueMemberWriteSequence.__delslice__c             C   s   d S)z`x.__iadd__(y)` <==> `x += y`Nr   )yr   r   r   __iadd__   s    z#IUniqueMemberWriteSequence.__iadd__c             C   s   d S)zAppend item to endNr   )r   r   r   r   append   s    z!IUniqueMemberWriteSequence.appendc             C   s   d S)zInsert item before indexNr   )r   r   r   r   r   insert   s    z!IUniqueMemberWriteSequence.insert   c             C   s   d S)z.Remove and return item at index (default last)Nr   )r   r   r   r   pop   s    zIUniqueMemberWriteSequence.popc             C   s   d S)z Remove first occurrence of valueNr   )r   r   r   r   remove   s    z!IUniqueMemberWriteSequence.removec               C   s   d S)zReverse *IN PLACE*Nr   r   r   r   r   reverse   s    z"IUniqueMemberWriteSequence.reverseNc             C   s   d S)z3Stable sort *IN PLACE*; `cmpfunc(x, y)` -> -1, 0, 1Nr   )Zcmpfuncr   r   r   sort   s    zIUniqueMemberWriteSequence.sortc             C   s   d S)z3Extend list by appending elements from the iterableNr   )iterabler   r   r   extend   s    z!IUniqueMemberWriteSequence.extend)r   r	   r
   r   r#   r$   r%   r&   r(   r)   r*   r,   r-   r.   r/   r1   r   r   r   r   r"   a   s   r"   c               @   s"   e  Z d  Z d Z d d   Z d S)IWriteSequencez!Full write contract for sequencesc             C   s   d S)z`x.__imul__(n)` <==> `x *= n`Nr   )r   r   r   r   __imul__   s    zIWriteSequence.__imul__N)r   r	   r
   r   r4   r   r   r   r   r3      s   r3   c               @   s   e  Z d  Z d Z d S)	ISequencezFull sequence contractN)r   r	   r
   r   r   r   r   r   r5      s   r5   N)r   Z__docformat__Zzope.interfacer   r   r   r   r   r"   r3   r5   r   r   r   r   <module>   s   )8