Permalink
Browse files

add delattr support

  • Loading branch information...
lzyy committed Apr 23, 2012
1 parent a164302 commit 190016a74d3692e9f408b8115ed1de5a4f4e1c2b
Showing with 6 additions and 0 deletions.
  1. +6 −0 thing/thing.py
View
@@ -115,6 +115,12 @@ def _init_env(self):
@property
def saved(self):
return not bool(self._unsaved_items)
+
+ def __delattr__(self, key):
+ if key in self._current_item:
+ del self._current_item[key]
+ elif key in self._unsaved_items:
+ del self._unsaved_items[key]
def __getattr__(self, key):
if key in self._current_item:

0 comments on commit 190016a

Please sign in to comment.