
    Ng                        d Z dZddlmZ ddlmZ ddlmZ  G d dej                        Z
 G d d	ej                  e
      Z G d
 dej                  e      Z G d de      Z G d de      Z G d de      Z G d dee      Zy)a  
Sequence Interfaces

Importing this module does *not* mark any standard classes as
implementing any of these interfaces.

While this module is not deprecated, new code should generally use
:mod:`zope.interface.common.collections`, specifically
:class:`~zope.interface.common.collections.ISequence` and
:class:`~zope.interface.common.collections.IMutableSequence`. This
module is occasionally useful for its fine-grained breakdown of interfaces.

The standard library :class:`list`, :class:`tuple` and
:class:`collections.UserList`, among others, implement ``ISequence``
or ``IMutableSequence`` but *do not* implement any of the interfaces
in this module.
restructuredtext    )	Interface)collections)PYTHON2c                       e Zd ZdZd Zy)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                      y)z``x.__getitem__(index) <==> x[index]``

        Declaring this interface does not specify whether `__getitem__`
        supports slice objects.N indexs    Y/var/www/djangounited/venv/lib/python3.12/site-packages/zope/interface/common/sequence.py__getitem__zIMinimalSequence.__getitem__4           N)__name__
__module____qualname____doc__r   r
   r   r   r   r   %   s    #r   r   c                       e Zd ZdZy)IFiniteSequencez[
    A sequence of bound size.

    .. versionchanged:: 5.0.0
       Extend ``ISized``
    Nr   r   r   r   r
   r   r   r   r   :   s    r   r   c                   X    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erd Zyy)IReadSequencea.  
    read interface shared by tuple and list

    This interface is similar to
    :class:`~zope.interface.common.collections.ISequence`, but
    requires that all instances be totally ordered. Most users
    should prefer ``ISequence``.

    .. versionchanged:: 5.0.0
       Extend ``IContainer``
    c                      y)z'``x.__contains__(item) <==> item in x``Nr
   items    r   __contains__zIReadSequence.__contains__O   r   r   c                      y)z"``x.__lt__(other) <==> x < other``Nr
   others    r   __lt__zIReadSequence.__lt__S   r   r   c                      y)z#``x.__le__(other) <==> x <= other``Nr
   r   s    r   __le__zIReadSequence.__le__V   r   r   c                      y)z#``x.__eq__(other) <==> x == other``Nr
   r   s    r   __eq__zIReadSequence.__eq__Y   r   r   c                      y)z#``x.__ne__(other) <==> x != other``Nr
   r   s    r   __ne__zIReadSequence.__ne__\   r   r   c                      y)z"``x.__gt__(other) <==> x > other``Nr
   r   s    r   __gt__zIReadSequence.__gt___   r   r   c                      y)z#``x.__ge__(other) <==> x >= other``Nr
   r   s    r   __ge__zIReadSequence.__ge__b   r   r   c                      y)z#``x.__add__(other) <==> x + other``Nr
   r   s    r   __add__zIReadSequence.__add__e   r   r   c                      y)z``x.__mul__(n) <==> x * n``Nr
   ns    r   __mul__zIReadSequence.__mul__h   r   r   c                      y)z``x.__rmul__(n) <==> n * x``Nr
   r/   s    r   __rmul__zIReadSequence.__rmul__k   r   r   c                      y)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js     r   __getslice__zIReadSequence.__getslice__o   r   r   N)r   r   r   r   r   r!   r#   r%   r'   r)   r+   r-   r1   r3   PY2r8   r
   r   r   r   r   B   sH    
61222122*+ 	 r   r   c                       e Zd ZdZd Zd Zy)IExtendedReadSequencezFull read interface for listsc                      y)z%Return number of occurrences of valueNr
   r   s    r   countzIExtendedReadSequence.countz   r   r   c                      y)zTindex(value, [start, [stop]]) -> int

        Return first index of *value*
        Nr
   )r   argss     r   r   zIExtendedReadSequence.index}   r   r   N)r   r   r   r   r=   r   r
   r   r   r;   r;   w   s    '4r   r;   c                   `    e Zd ZdZd Zd Zerd Zd Zd Z	d Z
d Zdd	Zd
 Zd ZddZd Zy)IUniqueMemberWriteSequencezAThe write contract for a sequence that may enforce unique membersc                      y)z``x.__setitem__(index, item) <==> x[index] = item``

        Declaring this interface does not specify whether `__setitem__`
        supports slice objects.
        Nr
   r   r   s     r   __setitem__z&IUniqueMemberWriteSequence.__setitem__   r   r   c                      y)z``x.__delitem__(index) <==> del x[index]``

        Declaring this interface does not specify whether `__delitem__`
        supports slice objects.
        Nr
   r   s    r   __delitem__z&IUniqueMemberWriteSequence.__delitem__   r   r   c                      y)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
   )r6   r7   r    s      r   __setslice__z'IUniqueMemberWriteSequence.__setslice__   r   r   c                      y)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
   r5   s     r   __delslice__z'IUniqueMemberWriteSequence.__delslice__   r   r   c                      y)z``x.__iadd__(y) <==> x += y``Nr
   )ys    r   __iadd__z#IUniqueMemberWriteSequence.__iadd__   r   r   c                      y)zAppend item to endNr
   r   s    r   appendz!IUniqueMemberWriteSequence.append   r   r   c                      y)zInsert item before indexNr
   rC   s     r   insertz!IUniqueMemberWriteSequence.insert   r   r   c                      y)z.Remove and return item at index (default last)Nr
   r   s    r   popzIUniqueMemberWriteSequence.pop   r   r   c                      y)z Remove first occurrence of valueNr
   r   s    r   removez!IUniqueMemberWriteSequence.remove   r   r   c                       y)zReverse *IN PLACE*Nr
   r
   r   r   reversez"IUniqueMemberWriteSequence.reverse   r   r   Nc                      y)z3Stable sort *IN PLACE*; `cmpfunc(x, y)` -> -1, 0, 1Nr
   )cmpfuncs    r   sortzIUniqueMemberWriteSequence.sort   r   r   c                      y)z3Extend list by appending elements from the iterableNr
   )iterables    r   extendz!IUniqueMemberWriteSequence.extend   r   r   ))N)r   r   r   r   rD   rF   r9   rH   rJ   rM   rO   rQ   rS   rU   rW   rZ   r]   r
   r   r   rA   rA      sH    K 		,!'=/!BBr   rA   c                       e Zd ZdZd Zy)IWriteSequencez!Full write contract for sequencesc                      y)z``x.__imul__(n) <==> x *= n``Nr
   r/   s    r   __imul__zIWriteSequence.__imul__   r   r   N)r   r   r   r   rb   r
   r   r   r`   r`      s
    +,r   r`   c                       e Zd ZdZy)	ISequencea  
    Full sequence contract.

    New code should prefer
    :class:`~zope.interface.common.collections.IMutableSequence`.

    Compared to that interface, which is implemented by :class:`list`
    (:class:`~zope.interface.common.builtins.IList`), among others,
    this interface is missing the following methods:

        - clear

        - count

        - index

    This interface adds the following methods:

        - sort
    Nr   r
   r   r   rd   rd      s    r   rd   N)r   __docformat__zope.interfacer   zope.interface.commonr   zope.interface._compatr   r9   	IIterabler   ISizedr   
IContainerr   r;   rA   r`   rd   r
   r   r   <module>rl      s   $ # $ - 1#{,, #*k((*: 3K**O 3j
M 
8B 8Bt,/ ,~ r   