forgi 2.0.0 documentation

«  forgi.utilities.numbered_dotbracket module   ::   Contents   ::   forgi.utilities.stuff module  »

forgi.utilities.observedDict module

class forgi.utilities.observedDict.observedDict(value=[], on_change=<function <lambda>>)[source]

Bases: future.types.newdict.newdict

A dictionary superclass.

A simplified (and less powerful) version of http://code.activestate.com/recipes/306864-list-and-dictionary-observer/, which is written by Bernhard Mulder and licensed under the PSF license.

Whenever a value changes, is added to or deleted from the dictionary, the function on_change will be called with the key as sole argument.

clear()[source]
pop(k, x=None)[source]
popitem()[source]
setdefault(key, value=None)[source]
update(other_dict)[source]

«  forgi.utilities.numbered_dotbracket module   ::   Contents   ::   forgi.utilities.stuff module  »