You are here: Home / LBN / Up2date / Plone and Zope / BastionLinux 13 / zope-zc.mappingobject-1.0.0-1.lbn13.noarch

zope-zc.mappingobject-1.0.0-1.lbn13.noarch

Package Attributes
RPM  zope-zc.mappingobject-1.0.0-1.lbn13.noarch.rpm Architecture  noarch Size  7299 Created  2017/08/04 11:07:28 UTC
Package Specification
Summary Sometimes, you want to use a mapping object like a regular object.
Group Application/Internet
License ZPL
Home Page http://pypi.python.org
Description

zc.mappingobject provides a wrapper for a mapping objects that provides both attribute and item access.

>>> import zc.mappingobject >>> mapping = dict(a=1) >>> ob = zc.mappingobject.mappingobject(mapping)

>>> ob.a 1 >>> ob.a = 2 >>> ob.a 2 >>> mapping {'a': 2}

>>> list(ob) ['a']

>>> len(ob) 1

>>> ob['a'] = 3 >>> ob.a 3 >>> mapping {'a': 3}

>>> del ob.a >>> mapping {} >>> ob.a Traceback (most recent call last): ... AttributeError: a

>>> ob.b = 1 >>> mapping {'b': 1}

>>> del ob['b'] >>> mapping

Requires
rpmlib(PayloadFilesHavePrefix)  
rpmlib(FileDigests)  
rpmlib(PartialHardlinkSets)  
rpmlib(CompressedFileNames)  
/bin/sh  
rpmlib(PayloadIsXz)  
Provides
zope-zc.mappingobject

Document Actions