Segmented sequence implementation for large lists.
itertools
Sequence
Iterable0
address0
address(seq, start, stop)
Find the address of the absolute slice.
delete0
delete(seq, start, stop)
insert584%
insert(seq, offset, insertion)
Segments0
Manage a sequence of sequences as if it were a single sequence. Primarily used to control maximum memory moves for each insertion when dealing with (relatively) naive sequence implementations.
Segments does not make assumptions about the size of the lists; full scans of the list sizes must be used to identify proper placement with exception to recently organized Segments instance where the size of each segment is already known.
Segments__slots__0
__slots__ = ('sequences', '_length')
SegmentsType0
Type = list
Segmentssegment_size
segment_size = 64
Segments__init__0
__init__(self)
Segments__getitem__0
__getitem__(self, item)
Segments__setitem__292%
__setitem__(self, item, value)
Segments__delitem__473%
__delitem__(self, item)
Segments__len__0
__len__(self)
Segments__iadd__40%
__iadd__(self, sequence)
Segmentsselect0
select(self, start, stop)
Return an iterable to the requested slice.
Segments__iter__0
__iter__(self)
Segmentsclear0
clear(self)
Truncate the entire sequence.
Segmentspartition0
partition(self)
Organize the segments so that they have appropriate sizes.
Segmentsprepend40%
prepend(self, sequence)
Segmentsappend0
append(self, sequence)
Segmentsinsert0
insert(self, offset, sequence)
Segmentsdelete286%
delete(self, start, stop)
Segmentsusage50%
usage(self)
Identify the primary memory using objects.
Immutable0
Segments compatible sequence that disregards manipulations to provide, cooperative, read-only access to an element sequence. Internal storage is a regular list and no attempt is made to enforce immutability outside of the interface.
Immutable__slots__0
__slots__ = ('_constant',)
Immutable__init__10%
__init__(self, items)
Immutableusage30%
usage(self)
Immutableselect150%
select(self, start, stop)
Immutable__iter__10%
__iter__(self)
Immutable__getitem__30%
__getitem__(self, item)
Immutable__setitem__10%
__setitem__(self, item, value)
Immutable__delitem__10%
__delitem__(self, item)
Immutable__len__10%
__len__(self)
Immutable__iadd__10%
__iadd__(self, sequence)
Immutableclear10%
clear(self)
Immutablepartition10%
partition(self)
Immutableprepend10%
prepend(self, sequence)
Immutableappend10%
append(self, sequence)
Immutableinsert10%
insert(self, offset, sequence)
Immutabledelete10%
delete(self, start, stop)