class documentation

class SequenceView(Sequence): (source)

View In Hierarchy

Return a read-only view of the sequence object *target*. :class:`SequenceView` objects are analogous to Python's built-in "dictionary view" types. They provide a dynamic view of a sequence's items, meaning that when the sequence updates, so does the view. >>> seq = ['0', '1', '2'] >>> view = SequenceView(seq) >>> view SequenceView(['0', '1', '2']) >>> seq.append('3') >>> view SequenceView(['0', '1', '2', '3']) Sequence views support indexing, slicing, and length queries. They act like the underlying sequence, except they don't allow assignment: >>> view[1] '1' >>> view[1:-1] ['1', '2'] >>> len(view) 4 Sequence views are useful as an alternative to copying, as they don't require (much) extra storage.

Method __getitem__ Undocumented
Method __init__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Instance Variable _target Undocumented
def __getitem__(self, index): (source)

Undocumented

def __init__(self, target): (source)

Undocumented

def __len__(self): (source)

Undocumented

def __repr__(self): (source)

Undocumented

Undocumented