Unbreak highlighting with python-mode
Clarify and document ensure_endpoint invariants