Example #1
0
 def add_handler(self, index, func):
     try:
         if isinstance(index, str):
             index = self.__class__._ltype.event_table[index]      
         n = slist.prepend(self._events[index], func)
         self._events[index] = n
     except Exception, ex:
         raise ex
Example #2
0
 def add_child(self, child):
     assert isinstance(child, Object)
     self._children = slist.prepend(self._children, child)
Example #3
0
import slist

class Moo(object):
    def __del__(self):
        print self

def pprint(n):
    while n is not None:
        print n.data
        n = n.next
  
n = None

n = slist.prepend(n, Moo())
n = slist.prepend(n, Moo())

pprint(n)

#n = slist.remove(n, 1)
#n = slist.remove(n, 2)

#pprint(n)