######################## wardrobe's documentation ######################## wardrobe is a Python project that provides a stack-based datastructure: :py:class:`StackedDict`. :py:class:`StackedDict` is a dictionary-like object with additional methods to save the current state (commit) and restore it (reset). .. doctest:: >>> from wardrobe import StackedDict >>> clark = StackedDict(top='blue bodysuit', bottom='red underpants', ... sex_appeal=True) >>> clark['bottom'] 'red underpants' >>> clark['friend'] = 'Lois' >>> dict(clark) == {'top': 'blue bodysuit', ... 'bottom': 'red underpants', ... 'friend': 'Lois', ... 'sex_appeal': True} True >>> clark.commit() # doctest: +ELLIPSIS >>> clark.update({'top': 'shirt', 'bottom': 'jeans', 'head': 'glasses'}) >>> del clark['sex_appeal'] >>> dict(clark) == {'top': 'shirt', ... 'bottom': 'jeans', ... 'head': 'glasses', ... 'friend': 'Lois'} True >>> clark.reset() # doctest: +ELLIPSIS >>> dict(clark) == {'top': 'blue bodysuit', ... 'bottom': 'red underpants', ... 'friend': 'Lois', ... 'sex_appeal': True} True ******** Contents ******** .. toctree:: :maxdepth: 2 INSTALL api/index about/index dev ********** Ressources ********** * `online documentation `_ * `PyPI page `_ * `code repository `_ * `bugtracker `_ ****************** Indices and tables ****************** * :ref:`genindex` * :ref:`modindex` * :ref:`search`