Current File : //usr/lib/python3/dist-packages/zope/interface/common/__pycache__/sequence.cpython-312.pyc |
�
��e� � � � d Z dZddlmZ ddlmZ G d� dej � Z G d� dej e� Z G d � d
ej e � Z G d� de� Z G d
� de� Z
G d� de
� Z G d� dee� Zy)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 Zd ZdZd� Zy)�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 �@/usr/lib/python3/dist-packages/zope/interface/common/sequence.py�__getitem__zIMinimalSequence.__getitem__3 � � � N)�__name__�
__module__�__qualname__�__doc__r
r r r r r $ s � ��#r r c � � e Zd ZdZy)�IFiniteSequencez[
A sequence of bound size.
.. versionchanged:: 5.0.0
Extend ``ISized``
N�r r r r r r r r r 9 s � �r r c �L � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
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__zIReadSequence.__contains__N r r c � � y)z"``x.__lt__(other) <==> x < other``Nr ��others r �__lt__zIReadSequence.__lt__R r r c � � y)z#``x.__le__(other) <==> x <= other``Nr r s r �__le__zIReadSequence.__le__U r r c � � y)z#``x.__eq__(other) <==> x == other``Nr r s r �__eq__zIReadSequence.__eq__X r r c � � y)z#``x.__ne__(other) <==> x != other``Nr r s r �__ne__zIReadSequence.__ne__[ r r c � � y)z"``x.__gt__(other) <==> x > other``Nr r s r �__gt__zIReadSequence.__gt__^ r r c � � y)z#``x.__ge__(other) <==> x >= other``Nr r s r �__ge__zIReadSequence.__ge__a r r c � � y)z#``x.__add__(other) <==> x + other``Nr r s r �__add__zIReadSequence.__add__d r r c � � y)z``x.__mul__(n) <==> x * n``Nr ��ns r �__mul__zIReadSequence.__mul__g r r c � � y)z``x.__rmul__(n) <==> n * x``Nr r. s r �__rmul__zIReadSequence.__rmul__j r r N)r r r r r r r"