GNU bug report logs -
#56903
progmode/python.el enhancement request.
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
This enhancement request is about progmode/python.el .
A
Let us follow up the commit 35d0190, "Properly indent Python PEP634 match/case blocks"
It introduced two code-block starter words, "match" and "case". Good. But "case" should also dedent, like shown in this tutorial [1], or PEP 636 [2]. (I failed to patch python.el. My naive attempt didn't work.)
[1] https://docs.python.org/3/tutorial/controlflow.html#match-statements
[2] https://peps.python.org/pep-0636/
B
"match" and "case" are not reserved words, but "soft keywords" [3]. This means they can be freely used as variables and function names.
[3] https://peps.python.org/pep-0634/#the-match-statement
I request they be font-locked like "if", "def" etc when used as a code block starter. (Something like r'^\s+(match|case)( .*)?:$'.) Currently they are shown in a plain face.
C
Some cleanups: In python.el, three comments mention "Python 3.5+ PEP492". It doesn't hurt at all, but Python 3.5 appeared back in 2015, [4] so IMHO removing them won't hurt, either.
[4] https://peps.python.org/pep-0478/
Thanks a lot for developing Emacs. Regards.
Teika
This bug report was last modified 2 years and 317 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.