Inversion Of Control Python