degal/utils.py
changeset 139 d3167c40e7b9
parent 128 f66bb9f6126a
equal deleted inserted replaced
138:130fb8a8dbb9 139:d3167c40e7b9
    82         Un-load the named attributes from the given object.
    82         Un-load the named attributes from the given object.
    83     """
    83     """
    84     
    84     
    85     for attr in attrs :
    85     for attr in attrs :
    86         if attr in obj.__dict__ :
    86         if attr in obj.__dict__ :
       
    87             # this will drop refcounts and free resources, so it may take some execution time
    87             del obj.__dict__[attr]
    88             del obj.__dict__[attr]
    88 
    89 
    89 def first (iterable) :
    90 def first (iterable) :
    90     """
    91     """
    91         Returns the first item from the iterable that evaluates to True, otherwise None.
    92         Returns the first item from the iterable that evaluates to True, otherwise None.