In python-mode, def and class are not highlighted as keywords until the function or class name is started. The attached patch will highlight these properly without requiring whitespace or a name afterwards. This makes it more like elisp-mode, java-mode, cc-mode, and js2-mode. Thanks, Nathaniel Flath