bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21783: 25.0.50; python.el does not support new Python 3.5 keywords


From: Lele Gaifax
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
User-agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/25.0.50.12 (x86_64-pc-linux-gnu)

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.

Attachment: python_el+pep492.patch
Description: Add PEP492 support to python.el

-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]