Python signals module (extracted from django)