GNU bug report logs - #21783
25.0.50; python.el does not support new Python 3.5 keywords

Previous Next

Package: emacs;

Reported by: Lele Gaifax <lele <at> metapensiero.it>

Date: Thu, 29 Oct 2015 12:28:02 UTC

Severity: normal

Tags: patch

Merged with 23145, 23147, 23148, 23149, 23150

Found in versions 25.0.50, 25.1.50

Done: Jorgen Schäfer <jorgen.schaefer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lele Gaifax <lele <at> metapensiero.it>
To: 21783 <at> debbugs.gnu.org
Subject: bug#21783: 25.0.50; python.el does not support new Python 3.5 keywords
Date: Thu, 29 Oct 2015 10:00:04 +0100
[Message part 1 (text/plain, inline)]
Python 3.5, released in mid September 2015, introduced a few new keywords
to better support asynchronous code, "async" and "await" in particular. See
https://www.python.org/dev/peps/pep-0492/ for details.

To avoid breaking already written users code, they are technically not
"reserved keywords", but accordingly to the plan they will become that in
Python 3.7 (https://www.python.org/dev/peps/pep-0492/#id75).

Currently python.el doesn't know anything about them, so it obviously cannot
properly indent the following code:

  async def coroutine(foo, bar):
  |

where "|" represent the cursor position, nor highlight them in any way.

I'm attaching a patch that implements such support, with some test cases. See
also the thread http://thread.gmane.org/gmane.emacs.devel/190950 where I
initially sent the same patch and where I've been solicited to create a bug
report.

Hope this helps,

thanks in advance,
ciao, lele.

[python_el+pep492.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele <at> metapensiero.it  |                 -- Fortunato Depero, 1929.

This bug report was last modified 9 years and 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.