This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: The Python 3 Docs don't highlight nonlocal
Type: Stage: needs patch
Components: Documentation Versions: Python 3.2, Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Ramchandra Apte, benjamin.peterson, berker.peksag, docs@python, eric.araujo, ezio.melotti, georg.brandl, me, sandro.tosi
Priority: normal Keywords:

Created on 2012-01-16 13:28 by Ramchandra Apte, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (10)
msg151362 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2012-01-16 13:28
The Python 3 Docs don't highlight nonlocal such as in the code example in the Python 3 documentation for itertools.zip_longest() (http://docs.python.org/py3k/library/itertools.html)
msg151365 - (view) Author: me (me) Date: 2012-01-16 14:31
Nonlocal is highlighted under Language Reference under simple statements section 6.13 (http://docs.python.org/dev/reference/index.html).  help("nonlocal") will also bring up the documentation (works for me in 3.3).
msg151367 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-01-16 14:41
Not really.  If you follow the link given in the first message and compare how “is” and “nonlocal” are styled, you will see the bug.  :)

I hope that Sphinx configures Pygments to use a Python3Lexer, not Python.  Georg?
msg151368 - (view) Author: me (me) Date: 2012-01-16 14:48
Ahh yes I see it.  Sorry about that.
msg151374 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-01-16 15:36
The problem was until very recently, pygments omitted the nonlocal keyword. We probably need to wait for another pygments release.
msg164639 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2012-07-04 06:10
What is the status of this bug?
msg169162 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-08-26 06:55
Sphinx is configured to use Python3Lexer (highlight_language is set to 'python3' in Doc/conf.py).
'nonlocal' is not highlighted because in the pygments version that we are using 'nonlocal' is missing in Python3Lexer.tokens['keywords'] see (Doc/tools/pygments/lexers/agile.py:196).
If this is fixed in more recent pygments versions, we only have to update our version.
msg169163 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2012-08-26 08:12
> 'nonlocal' is not highlighted because in the pygments version that we are using 'nonlocal' is missing in Python3Lexer.tokens['keywords'] see (Doc/tools/pygments/lexers/agile.py:196).

The nonlocal keyword has been added in Pygments 1.5.

https://bitbucket.org/birkenfeld/pygments-main/src/972a251fa742/pygments/lexers/agile.py#cl-202
msg169164 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-08-26 10:07
Our version is 1.3.1.  Georg said that this can be update after the 3.3 release.
msg171648 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2012-09-30 16:15
Pygments is now updated to 1.5pre.
History
Date User Action Args
2022-04-11 14:57:25adminsetgithub: 58009
2012-09-30 16:15:45georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg171648
2012-08-26 10:07:06ezio.melottisetmessages: + msg169164
versions: + Python 3.4
2012-08-26 08:12:54berker.peksagsetnosy: + berker.peksag
messages: + msg169163
2012-08-26 06:55:59ezio.melottisetmessages: + msg169162
2012-07-04 06:10:45Ramchandra Aptesetmessages: + msg164639
2012-01-16 18:52:09sandro.tosisetnosy: + sandro.tosi
2012-01-16 15:36:07benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg151374
2012-01-16 14:48:46mesetmessages: + msg151368
2012-01-16 14:41:28eric.araujosetnosy: + eric.araujo
title: The Python 3 Docs doesn't highlight nonlocal -> The Python 3 Docs don't highlight nonlocal
messages: + msg151367

stage: needs patch
2012-01-16 14:31:40mesetnosy: + me
messages: + msg151365
2012-01-16 13:31:11ezio.melottisetnosy: + georg.brandl, ezio.melotti

versions: - Python 3.1
2012-01-16 13:28:54Ramchandra Aptesetassignee: docs@python

nosy: + docs@python
components: + Documentation
versions: + Python 3.1, Python 3.2, Python 3.3
2012-01-16 13:28:29Ramchandra Aptesettitle: The Python 3 Docs don't highlight nonlocal -> The Python 3 Docs doesn't highlight nonlocal
2012-01-16 13:28:04Ramchandra Aptecreate