U
    ÈZj§  ã                   @   sŠ   d Z dZddlmZ G dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZ	G dd„ dee	ƒZ
dS )zySequence Interfaces

Importing this module does *not* mark any standard classes
as implementing any of these interfaces.
Ú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; integer
      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   úa/var/www/html/TRUCKING_PROJECT/venv/lib/python3.8/site-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                   @   sh   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__4   s    zIReadSequence.__contains__c                 C   s   dS )z"``x.__lt__(other) <==> x < other``Nr   ©Úotherr   r   r   Ú__lt__7   s    zIReadSequence.__lt__c                 C   s   dS )z#``x.__le__(other) <==> x <= other``Nr   r   r   r   r   Ú__le__:   s    zIReadSequence.__le__c                 C   s   dS )z#``x.__eq__(other) <==> x == other``Nr   r   r   r   r   Ú__eq__=   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__C   s    zIReadSequence.__gt__c                 C   s   dS )z#``x.__ge__(other) <==> x >= other``Nr   r   r   r   r   Ú__ge__F   s    zIReadSequence.__ge__c                 C   s   dS )z#``x.__add__(other) <==> x + other``Nr   r   r   r   r   Ú__add__I   s    zIReadSequence.__add__c                 C   s   dS )z``x.__mul__(n) <==> x * n``Nr   ©Únr   r   r   Ú__mul__L   s    zIReadSequence.__mul__c                 C   s   dS )z``x.__rmul__(n) <==> n * x``Nr   r   r   r   r   Ú__rmul__O   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__R   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   1   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   Úcount]   s    zIExtendedReadSequence.countc                 G   s   dS )zTindex(value, [start, [stop]]) -> int

        Return first index of *value*
        Nr   )r   Úargsr   r   r   r   `   s    zIExtendedReadSequence.indexN)r
   r   r   r   r&   r   r   r   r   r   r%   Z   s   r%   c                   @   st   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__i   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__p   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__w   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   Ú__delslice__   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   Ú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)r2   )N)r
   r   r   r   r*   r+   r,   r-   r/   r0   r1   r3   r4   r5   r6   r8   r   r   r   r   r(   f   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   r:   r   r   r   r   r9   ž   s   r9   c                   @   s   e Zd ZdZdS )Ú	ISequencezFull sequence contractN)r
   r   r   r   r   r   r   r   r;   ¤   s   r;   N)r   Ú__docformat__Zzope.interfacer   r   r   r   r%   r(   r9   r;   r   r   r   r   Ú<module>   s   )8