o
    gHd                     @   s   d Z dZddlmZ ddlmZ G dd dejZG dd dejeZ	G d	d
 d
ej
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 )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                   @      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      dS )z``x.__getitem__(index) <==> x[index]``

        Declaring this interface does not specify whether `__getitem__`
        supports slice objects.N indexr   r   e/var/www/html/facialservice/flask-venv/lib/python3.10/site-packages/zope/interface/common/sequence.py__getitem__3       zIMinimalSequence.__getitem__N)__name__
__module____qualname____doc__r   r   r   r   r   r   $   s    r   c                   @      e Zd ZdZdS )IFiniteSequencez[
    A sequence of bound size.

    .. versionchanged:: 5.0.0
       Extend ``ISized``
    Nr   r   r   r   r   r   r   r   r   9       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S )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                 C   r   )z'``x.__contains__(item) <==> item in x``Nr   itemr   r   r   __contains__N   r   zIReadSequence.__contains__c                 C   r   )z"``x.__lt__(other) <==> x < other``Nr   otherr   r   r   __lt__R   r   zIReadSequence.__lt__c                 C   r   )z#``x.__le__(other) <==> x <= other``Nr   r   r   r   r   __le__U   r   zIReadSequence.__le__c                 C   r   )z#``x.__eq__(other) <==> x == other``Nr   r   r   r   r   __eq__X   r   zIReadSequence.__eq__c                 C   r   )z#``x.__ne__(other) <==> x != other``Nr   r   r   r   r   __ne__[   r   zIReadSequence.__ne__c                 C   r   )z"``x.__gt__(other) <==> x > other``Nr   r   r   r   r   __gt__^   r   zIReadSequence.__gt__c                 C   r   )z#``x.__ge__(other) <==> x >= other``Nr   r   r   r   r   __ge__a   r   zIReadSequence.__ge__c                 C   r   )z#``x.__add__(other) <==> x + other``Nr   r   r   r   r   __add__d   r   zIReadSequence.__add__c                 C   r   )z``x.__mul__(n) <==> x * n``Nr   nr   r   r   __mul__g   r   zIReadSequence.__mul__c                 C   r   )z``x.__rmul__(n) <==> n * x``Nr   r#   r   r   r   __rmul__j   r   zIReadSequence.__rmul__N)r   r   r   r   r   r   r   r   r   r    r!   r"   r%   r&   r   r   r   r   r   A   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   r   )z%Return number of occurrences of valueNr   r   r   r   r   countq   r   zIExtendedReadSequence.countc                 G   r   )zTindex(value, [start, [stop]]) -> int

        Return first index of *value*
        Nr   )r   argsr   r   r   r
   t   r   zIExtendedReadSequence.indexN)r   r   r   r   r(   r
   r   r   r   r   r'   n   s    r'   c                   @   sd   e Zd Z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   r   )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__}   r   z&IUniqueMemberWriteSequence.__setitem__c                 C   r   )z``x.__delitem__(index) <==> del x[index]``

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