The author should try adding this to his .git/info/attributes file:
*.py diff=python
That should make --function-context work better on python source files.