Adding smart-tab detection for python mode