Backport Use derived-mode-p in python.el instead of equality test with major-mode