From 7815b31c5ee06bbb3d937b3fea22605fb10400be Mon Sep 17 00:00:00 2001 From: Kostas Papadimitriou Date: Thu, 1 Dec 2011 16:57:11 +0200 Subject: [PATCH] Expando `get` helper method Added a dict like `get` method to Expando class --- hyde/model.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hyde/model.py b/hyde/model.py index bef9a34..967df27 100644 --- a/hyde/model.py +++ b/hyde/model.py @@ -81,6 +81,12 @@ class Expando(object): result[k] = v return result + def get(self, key, default=None): + """ + Dict like get helper method + """ + return self.__dict__.get(key, default) + class Context(object): """