3 [@sdZdZddlmZGdddeZGdddeZGdd d eZGd d d eZGd d d eZGdddeZ Gdddee Z dS)zySequence Interfaces Importing this module does *not* mark any standard classes as implementing any of these interfaces. Zrestructuredtext) Interfacec@seZdZdZddZdS)IMinimalSequenceaMost 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). cCsdS)z``x.__getitem__(index) <==> x[index]`` Declaring this interface does not specify whether `__getitem__` supports slice objects.N)indexrr /usr/lib64/python3.6/sequence.py __getitem__&szIMinimalSequence.__getitem__N)__name__ __module__ __qualname____doc__rrrrrrs rc@seZdZddZdS)IFiniteSequencecCsdS)z``x.__len__() <==> len(x)``Nrrrrr__len__.szIFiniteSequence.__len__N)rr r r rrrrr ,sr c@sheZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZdS) IReadSequencez'read interface shared by tuple and listcCsdS)z'``x.__contains__(item) <==> item in x``Nr)itemrrr __contains__4szIReadSequence.__contains__cCsdS)z"``x.__lt__(other) <==> x < other``Nr)otherrrr__lt__7szIReadSequence.__lt__cCsdS)z#``x.__le__(other) <==> x <= other``Nr)rrrr__le__:szIReadSequence.__le__cCsdS)z#``x.__eq__(other) <==> x == other``Nr)rrrr__eq__=szIReadSequence.__eq__cCsdS)z#``x.__ne__(other) <==> x != other``Nr)rrrr__ne__@szIReadSequence.__ne__cCsdS)z"``x.__gt__(other) <==> x > other``Nr)rrrr__gt__CszIReadSequence.__gt__cCsdS)z#``x.__ge__(other) <==> x >= other``Nr)rrrr__ge__FszIReadSequence.__ge__cCsdS)z#``x.__add__(other) <==> x + other``Nr)rrrr__add__IszIReadSequence.__add__cCsdS)z``x.__mul__(n) <==> x * n``Nr)nrrr__mul__LszIReadSequence.__mul__cCsdS)z``x.__rmul__(n) <==> n * x``Nr)rrrr__rmul__OszIReadSequence.__rmul__cCsdS)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)ijrrr __getslice__RszIReadSequence.__getslice__N)rr r r rrrrrrrrrrrrrrrr1src@s eZdZdZddZddZdS)IExtendedReadSequencezFull read interface for listscCsdS)z%Return number of occurrences of valueNr)rrrrcount]szIExtendedReadSequence.countcGsdS)zTindex(value, [start, [stop]]) -> int Return first index of *value* Nr)rargsrrrr`szIExtendedReadSequence.indexN)rr r r r rrrrrrZsrc@steZdZdZddZddZddZdd Zd d Zd d Z ddZ dddZ ddZ ddZ dddZddZdS)IUniqueMemberWriteSequencezAThe write contract for a sequence that may enforce unique memberscCsdS)z``x.__setitem__(index, item) <==> x[index] = item`` Declaring this interface does not specify whether `__setitem__` supports slice objects. Nr)rrrrr __setitem__isz&IUniqueMemberWriteSequence.__setitem__cCsdS)z``x.__delitem__(index) <==> del x[index]`` Declaring this interface does not specify whether `__delitem__` supports slice objects. Nr)rrrr __delitem__psz&IUniqueMemberWriteSequence.__delitem__cCsdS)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)rrrrrr __setslice__wsz'IUniqueMemberWriteSequence.__setslice__cCsdS)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)rrrrr __delslice__sz'IUniqueMemberWriteSequence.__delslice__cCsdS)z``x.__iadd__(y) <==> x += y``Nr)yrrr__iadd__sz#IUniqueMemberWriteSequence.__iadd__cCsdS)zAppend item to endNr)rrrrappendsz!IUniqueMemberWriteSequence.appendcCsdS)zInsert item before indexNr)rrrrrinsertsz!IUniqueMemberWriteSequence.insertcCsdS)z.Remove and return item at index (default last)Nr)rrrrpopszIUniqueMemberWriteSequence.popcCsdS)z Remove first occurrence of valueNr)rrrrremovesz!IUniqueMemberWriteSequence.removecCsdS)zReverse *IN PLACE*Nrrrrrreversesz"IUniqueMemberWriteSequence.reverseNcCsdS)z3Stable sort *IN PLACE*; `cmpfunc(x, y)` -> -1, 0, 1Nr)ZcmpfuncrrrsortszIUniqueMemberWriteSequence.sortcCsdS)z3Extend list by appending elements from the iterableNr)iterablerrrextendsz!IUniqueMemberWriteSequence.extend)r2)N)rr r r r#r$r%r&r(r)r*r,r-r.r/r1rrrrr"fs  r"c@seZdZdZddZdS)IWriteSequencez!Full write contract for sequencescCsdS)z``x.__imul__(n) <==> x *= n``Nr)rrrr__imul__szIWriteSequence.__imul__N)rr r r r4rrrrr3sr3c@seZdZdZdS) ISequencezFull sequence contractN)rr r r rrrrr5sr5N) r Z __docformat__Zzope.interfacerrr rrr"r3r5rrrrs ) 8