Python Inner Function Modify Outer Variable Decelerations With Contractions