Most viewed recipes tagged "bunch"http://code.activestate.com/recipes/tags/bunch/views/2011-12-31T18:03:02-08:00ActiveState Code RecipesBunch class created from attributes in class (Python) 2011-12-31T18:03:02-08:00Fabio Zadroznyhttp://code.activestate.com/recipes/users/4180406/http://code.activestate.com/recipes/577999-bunch-class-created-from-attributes-in-class/ <p style="color: grey"> Python recipe 577999 by <a href="/recipes/users/4180406/">Fabio Zadrozny</a> (<a href="/recipes/tags/attributes/">attributes</a>, <a href="/recipes/tags/bunch/">bunch</a>, <a href="/recipes/tags/metaclass/">metaclass</a>). Revision 3. </p> <p>Provide a way to construct class __init__, __slots__, __eq__, __ne__, __repr__ for the class and makes explicit which attributes each instance will have (and providing defaults).</p> <p>The __main__ session shows an example of how it should be used.</p>