�
JDvc� � � � d Z dZddlmZ ddlmZ ddlmZ G d� dej � � Z
G d� d ej e
� � Z G d
� dej
e� � Z G d� d
e� � Z G d� de� � Z G d� de� � Z G d� dee� � ZdS )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 Zd ZdZd� ZdS )�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 � � dS )z�``x.__getitem__(index) <==> x[index]``
Declaring this interface does not specify whether `__getitem__`
supports slice objects.N� ��indexs �@/usr/lib/python3/dist-packages/zope/interface/common/sequence.py�__getitem__zIMinimalSequence.__getitem__4 � � � � � N)�__name__�
__module__�__qualname__�__doc__r r
r r
r r % s- � � � � � �� �#� #� #� #� #r r c � � e Zd ZdZdS )�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 �\ � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
erd� Zd
S 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 � � dS )z'``x.__contains__(item) <==> item in x``Nr
��items r
�__contains__zIReadSequence.__contains__O r r c � � dS )z"``x.__lt__(other) <==> x < other``Nr
��others r
�__lt__zIReadSequence.__lt__S r r c � � dS )z#``x.__le__(other) <==> x <= other``Nr
r s r
�__le__zIReadSequence.__le__V r r c � � dS )z#``x.__eq__(other) <==> x == other``Nr
r s r
�__eq__zIReadSequence.__eq__Y r r c � � dS )z#``x.__ne__(other) <==> x != other``Nr
r s r
�__ne__zIReadSequence.__ne__\ r r c � � dS )z"``x.__gt__(other) <==> x > other``Nr
r s r
�__gt__zIReadSequence.__gt___ r r c � � dS )z#``x.__ge__(other) <==> x >= other``Nr
r s r
�__ge__zIReadSequence.__ge__b r r c � � dS )z#``x.__add__(other) <==> x + other``Nr
r s r
�__add__zIReadSequence.__add__e r r c � � dS )z``x.__mul__(n) <==> x * n``Nr
��ns r
�__mul__zIReadSequence.__mul__h r r c � � dS )z``x.__rmul__(n) <==> n * x``Nr
r/ s r
�__rmul__zIReadSequence.__rmul__k r r c � � dS )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__zIReadSequence.__getslice__o r r N)r r r r r r! r# r% r' |