minor performance tweak in python version
Merge pull request #17 from felipou/master

minor performance tweak in python version