Hi there,
Starting from 'emacs -Q' I do the following:
1. Visit a new Python file ("~/test.py", say);
2. Enter the following lines:
----------------------------------------
import re
def test_re(string):
if re.match('^[a-c]+$', string):
print('yes')
else:
print('no')
----------------------------------------
3. Place the cursor on the "else:" line and press <TAB>.
This has the following effect on the buffer contents:
----------------------------------------
import re
def test_re(string):
if re.match('^[a-c]+$', string):
print('yes')
else:
print('no')
----------------------------------------
Pressing <TAB> repeatedly has no effect, this incorrect indentation is
the only indentation it allows.
I experience this issue with "python-mode" and "python-ts-mode", but
if I change "re.match" to "re.matches", the correct indentation is
preserved. So presumably the "match" in "re.match" is being treated as
a match statement.