[issue6858] This is a python file, apply syntax highlighting

gert cuykens report at bugs.python.org
Sun Aug 1 22:05:43 CEST 2010


gert cuykens <gert.cuykens at gmail.com> added the comment:

On Sun, Aug 1, 2010 at 4:55 PM, Tal Einat <report at bugs.python.org> wrote:
>
> Tal Einat <taleinat at gmail.com> added the comment:
>
> I'm +1 on adding such an option to the menu, if only to be able to highlight files including only Python code which don't happen to have the .py extension.
>
> If support for files including not only Python code is important to anyone, some examples of such files would be very helpful. I've never seen such files and I don't know how common such uses are.

Really, docs.python.org is full of examples with python code in it :)

Try to parse this html file
(http://docs.python.org/tutorial/controlflow.html)  for testing.

> Supporting files with some Python code in between other stuff is a different matter. Non-Python code being wrongly highlighted may be fine, but we'll need to make sure that the syntax highlighting is robust enough to be able to withstand going through a lot of invalid syntax, and still correctly highlight most of the Python code found in between. If IDLE fails to highlight a file it could of course fail gracefully, give an error message and not highlight, so I don't foresee this causing any stability issues.
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6858>
_______________________________________


More information about the Python-bugs-list mailing list