Python style implementation