Package glue :: Module segments :: Class _offsets
[hide private]
[frames] | no frames]

Class _offsets

source code

object --+    
         |    
      dict --+
             |
            _offsets

Implements the segmentlist offset book-keeping in the segmentlistdict class. Not intended for use outside of the segmentlistdict class.

Instance Methods [hide private]
 
__delitem__(*args)
del x[y]
source code
new empty dictionary

__init__(self, parent)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__reduce__(self)
helper for pickle
source code
 
__setitem__(self, key, value)
Set an offset.
source code
None
clear(self)
Remove the offsets from all segmentlists.
source code
New dict with keys from S and values equal to v
fromkeys(*args)
v defaults to None.
source code
v, remove specified key and return the corresponding value
pop(*args)
If key is not found, d is returned if given, otherwise KeyError is raised
source code
(k, v), remove and return some (key, value) pair as a
popitem(*args)
2-tuple; but raise KeyError if D is empty.
source code
None
update(self, d)
From a dictionary of offsets, apply each offset to the corresponding segmentlist.
source code

Inherited from dict: __cmp__, __contains__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __repr__, __sizeof__, copy, get, has_key, items, iteritems, iterkeys, itervalues, keys, setdefault, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, parent) source code
Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__delitem__(*args)
(Index deletion operator)

source code 

del x[y]

Overrides: dict.__delitem__
(inherited documentation)

__init__(self, parent)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

__new__(cls, parent)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

__reduce__(self)

source code 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

__setitem__(self, key, value)
(Index assignment operator)

source code 

Set an offset. If the new offset is identical to the current offset this is a no-op, otherwise the corresponding segmentlist object is shifted.

Overrides: dict.__setitem__

clear(self)

source code 

Remove the offsets from all segmentlists.

Returns: None
Overrides: dict.clear

fromkeys(*args)

source code 

v defaults to None.

Returns: New dict with keys from S and values equal to v
Overrides: dict.fromkeys
(inherited documentation)

pop(*args)

source code 

If key is not found, d is returned if given, otherwise KeyError is raised

Returns: v, remove specified key and return the corresponding value
Overrides: dict.pop
(inherited documentation)

popitem(*args)

source code 

2-tuple; but raise KeyError if D is empty.

Returns: (k, v), remove and return some (key, value) pair as a
Overrides: dict.popitem
(inherited documentation)

update(self, d)

source code 

From a dictionary of offsets, apply each offset to the corresponding segmentlist. NOTE: it is acceptable for the offset dictionary to contain entries for which there is no matching segmentlist; no error will be raised, but the offset will be ignored. This simplifies the case of updating several segmentlistdict objects from a common offset dictionary, when one or more of the segmentlistdicts contains only a subset of the keys.

Returns: None
Overrides: dict.update