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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jorgen Schäfer <jorgen.schaefer <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#21783: closed (25.0.50; python.el does not support new Python
 3.5 keywords)
Date: Wed, 06 Apr 2016 09:00:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 06 Apr 2016 08:59:20 +0000
with message-id <CALqDrScScGsFnHwQo4kwgVcrM_ti4NDgEWAwZ5UEULzcAH4SbQ <at> mail.gmail.com>
and subject line Patch applied
has caused the debbugs.gnu.org bug report #21783,
regarding 25.0.50; python.el does not support new Python 3.5 keywords
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
21783: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21783
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Lele Gaifax <lele <at> metapensiero.it>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; python.el does not support new Python 3.5 keywords
Date: Thu, 29 Oct 2015 10:00:04 +0100
[Message part 3 (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 5 (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.
[Message part 6 (message/rfc822, inline)]
From: Jorgen Schäfer <jorgen.schaefer <at> gmail.com>
To: 21783-close <at> debbugs.gnu.org
Subject: Patch applied
Date: Wed, 06 Apr 2016 08:59:20 +0000
[Message part 7 (text/plain, inline)]
Hello!
I just pushed this patch to git master as 1f6b0bc1. Thank you so much for
your contribution and I am very sorry that it took so long to get into the
repository.

Regards,
Jorgen
[Message part 8 (text/html, inline)]

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.