
    (ph                         S r SrSSKJr  SSKJr   " S S\R                  5      r " S S\R                  \5      r	 " S	 S
\R                  \	5      r " S S\5      r " S S\5      r " S S\5      r " S S\\5      rg)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)collectionsc                       \ rS rSrSrS rSrg)IMinimalSequence%   a  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                     g)z``x.__getitem__(index) <==> x[index]``

Declaring this interface does not specify whether `__getitem__`
supports slice objects.N indexs    Q/var/www/html/venv/lib/python3.13/site-packages/zope/interface/common/sequence.py__getitem__IMinimalSequence.__getitem__4           r
   N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes__r
   r   r   r   r   %   s    #r   r   c                       \ rS rSrSrSrg)IFiniteSequence;   zK
A sequence of bound size.

.. versionchanged:: 5.0.0
   Extend ``ISized``
r
   Nr   r   r   r   r   r   r
   r   r   r   r   ;   s    r   r   c                   T    \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rSrg)IReadSequenceD   a  
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                     g)z'``x.__contains__(item) <==> item in x``Nr
   items    r   __contains__IReadSequence.__contains__Q   r   r   c                     g)z"``x.__lt__(other) <==> x < other``Nr
   others    r   __lt__IReadSequence.__lt__U   r   r   c                     g)z#``x.__le__(other) <==> x <= other``Nr
   r%   s    r   __le__IReadSequence.__le__X   r   r   c                     g)z#``x.__eq__(other) <==> x == other``Nr
   r%   s    r   __eq__IReadSequence.__eq__[   r   r   c                     g)z#``x.__ne__(other) <==> x != other``Nr
   r%   s    r   __ne__IReadSequence.__ne__^   r   r   c                     g)z"``x.__gt__(other) <==> x > other``Nr
   r%   s    r   __gt__IReadSequence.__gt__a   r   r   c                     g)z#``x.__ge__(other) <==> x >= other``Nr
   r%   s    r   __ge__IReadSequence.__ge__d   r   r   c                     g)z#``x.__add__(other) <==> x + other``Nr
   r%   s    r   __add__IReadSequence.__add__g   r   r   c                     g)z``x.__mul__(n) <==> x * n``Nr
   ns    r   __mul__IReadSequence.__mul__j   r   r   c                     g)z``x.__rmul__(n) <==> n * x``Nr
   r<   s    r   __rmul__IReadSequence.__rmul__m   r   r   r
   N)r   r   r   r   r   r"   r'   r*   r-   r0   r3   r6   r9   r>   rA   r   r
   r   r   r   r   D   s9    
61222122*+r   r   c                   $    \ rS rSrSrS rS rSrg)IExtendedReadSequenceq   zFull read interface for listsc                     g)z%Return number of occurrences of valueNr
   r    s    r   countIExtendedReadSequence.countt   r   r   c                     g)zDindex(value, [start, [stop]]) -> int

Return first index of *value*
Nr
   )r!   argss     r   r   IExtendedReadSequence.indexw   r   r   r
   N)r   r   r   r   r   rG   r   r   r
   r   r   rD   rD   q   s    '4r   rD   c                   \    \ rS rSrSrS rS rS rS rS r	SS jr
S	 rS
 rSS jrS rSrg)IUniqueMemberWriteSequence~   zAThe write contract for a sequence that may enforce unique membersc                     g)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__&IUniqueMemberWriteSequence.__setitem__   r   r   c                     g)z``x.__delitem__(index) <==> del x[index]``

Declaring this interface does not specify whether `__delitem__`
supports slice objects.
Nr
   r   s    r   __delitem__&IUniqueMemberWriteSequence.__delitem__   r   r   c                     g)z``x.__iadd__(y) <==> x += y``Nr
   )ys    r   __iadd__#IUniqueMemberWriteSequence.__iadd__   r   r   c                     g)zAppend item to endNr
   r    s    r   append!IUniqueMemberWriteSequence.append   r   r   c                     g)zInsert item before indexNr
   rP   s     r   insert!IUniqueMemberWriteSequence.insert   r   r   c                     g)z.Remove and return item at index (default last)Nr
   r   s    r   popIUniqueMemberWriteSequence.pop   r   r   c                     g)z Remove first occurrence of valueNr
   r    s    r   remove!IUniqueMemberWriteSequence.remove   r   r   c                      g)zReverse *IN PLACE*Nr
   r
   r   r   reverse"IUniqueMemberWriteSequence.reverse   r   r   Nc                     g)z3Stable sort *IN PLACE*; `cmpfunc(x, y)` -> -1, 0, 1Nr
   )cmpfuncs    r   sortIUniqueMemberWriteSequence.sort   r   r   c                     g)z3Extend list by appending elements from the iterableNr
   )iterables    r   extend!IUniqueMemberWriteSequence.extend   r   r   r
   ))N)r   r   r   r   r   rQ   rT   rX   r[   r^   ra   rd   rg   rk   ro   r   r
   r   r   rM   rM   ~   s9    K,!'=/!BBr   rM   c                       \ rS rSrSrS rSrg)IWriteSequence   z!Full write contract for sequencesc                     g)z``x.__imul__(n) <==> x *= n``Nr
   r<   s    r   __imul__IWriteSequence.__imul__   r   r   r
   N)r   r   r   r   r   rv   r   r
   r   r   rs   rs      s
    +,r   rs   c                       \ rS rSrSrSrg)	ISequence   a  
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
r
   Nr   r
   r   r   ry   ry      s    r   ry   N)r   __docformat__zope.interfacer   zope.interface.commonr   	IIterabler   ISizedr   
IContainerr   rD   rM   rs   ry   r
   r   r   <module>r      s   $ # $ -#{,, #,k((*: *+K**O *+Z
M 
'B 'BT,/ ,~ r   