.. image:: https://travis-ci.org/TriOptima/tri.struct.svg?branch=master :target: https://travis-ci.org/TriOptima/tri.struct .. image:: http://codecov.io/github/TriOptima/tri.struct/coverage.svg?branch=master :target: http://codecov.io/github/TriOptima/tri.struct?branch=master
tri.struct supplies classes that can be used like dictionaries and as objects with attribute access at the same time. There are two versions:
Some niceties include:
merged
function call to merge different types of dicts into a new: merged(Struct(a=1), FrozenStruct(b=1), c=1) == Struct(a=1, b=1, c=1)
).. code:: python
>>> from tri_struct import Struct
>>> foo = Struct()
>>> foo.a = 1
>>> foo['a']
1
>>> foo['a'] = 2
>>> foo.a
2
You need tox installed then just make test
.
BSD