PY-24653 Fix `Self` highlighting in nested functions