Well for C++, it will generate a warning, and git diff will highlight it in red (if you have colorized diff). So it technically may not be needed for a python file, but I always like my git dffs to not have any red in them (trailing spaces, missing newline at EOF).

github is branch based, so the way that I normally do this type of thing is that I amend my original commit and then do a git push -f 

If you created additional commits, then I generally squash them down into a single commit (which is essentially the same thing as commit --amend) and then push -f

As long as the commits stay on the same branch, then the pull request will automagically be updated