Skip to content

Commit

Permalink
Merge pull request #1332 from jseabold/add-bunch-obj
Browse files Browse the repository at this point in the history
ENH: Add Bunch object to tools.
  • Loading branch information
jseabold committed Jan 27, 2014
2 parents a0fc6d1 + af91866 commit 2a1703f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions statsmodels/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,11 @@ def maybe_unwrap_results(results):
routines.
"""
return getattr(results, '_results', results)

class Bunch(dict):
"""
Returns a dict-like object with keys accessible via attribute lookup.
"""
def __init__(self, **kw):
dict.__init__(self, kw)
self.__dict__ = self

0 comments on commit 2a1703f

Please sign in to comment.