Latest recipes tagged "lightweight"http://code.activestate.com/recipes/tags/lightweight/new/2015-08-03T15:22:40-07:00ActiveState Code RecipesData (A Class For Arbitrary Data) (Python)
2015-08-03T15:22:40-07:00Alfehttp://code.activestate.com/recipes/users/4182236/http://code.activestate.com/recipes/579092-data-a-class-for-arbitrary-data/
<p style="color: grey">
Python
recipe 579092
by <a href="/recipes/users/4182236/">Alfe</a>
(<a href="/recipes/tags/class/">class</a>, <a href="/recipes/tags/data/">data</a>, <a href="/recipes/tags/lightweight/">lightweight</a>).
</p>
<p>A class which is designed to be easy to use when one needs a piece of data with a minimum of source required.</p>
<p>Usage:</p>
<pre class="prettyprint"><code>shop = Data(owner="Homer", address="down the street", ice=Data(flavor="vanilla", amount=3))
print shop
Data:
owner = 'Homer'
ice = Data:
amount = 3
flavor = 'vanilla'
address = 'down the street'
</code></pre>