unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56903: progmode/python.el enhancement request.
@ 2022-08-03  4:50 Teika Kazura
  0 siblings, 0 replies; only message in thread
From: Teika Kazura @ 2022-08-03  4:50 UTC (permalink / raw)
  To: 56903

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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-03  4:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03  4:50 bug#56903: progmode/python.el enhancement request Teika Kazura

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).