Python Same Method Differentiation Strategy