Python best practice

This PR aims at using the python best practice.