'Clean dead weak references from the dictionary'

def clean(self):

    mapping = self._mapping
    to_drop = [key for key in mapping if (key() is None)]
    for key in to_drop:
        val = mapping.pop(key)
        val.remove(key)
