degal/utils.py
changeset 128 f66bb9f6126a
parent 120 55cb7fc9c8fb
child 139 d3167c40e7b9
--- a/degal/utils.py	Mon Jun 15 01:42:45 2009 +0300
+++ b/degal/utils.py	Mon Jun 15 02:58:30 2009 +0300
@@ -77,6 +77,15 @@
 lazy_load = LazyProperty
 lazy_load_iter = LazyIteratorProperty
 
+def unload (obj, *attrs) :
+    """
+        Un-load the named attributes from the given object.
+    """
+    
+    for attr in attrs :
+        if attr in obj.__dict__ :
+            del obj.__dict__[attr]
+
 def first (iterable) :
     """
         Returns the first item from the iterable that evaluates to True, otherwise None.
@@ -86,7 +95,6 @@
         >>> first("abc")
         'a'
         >>> first(('', list(), (), False))
-        None
     """
 
     for item in iterable :