Great post saved it for when I need to optimize my python code