This question already has an answer here:

According to the editing help:

You can use either one of the supported prettify language codes, like lang-cpp or lang-sql, or you can specify a tag, and the syntax highlighting language associated with this tag will be used:

<!-- language: c# -->

    public static bool IsAwesome { get { return true; } }

However, in this revision history, <!-- language: python --> fails, yet <!-- language: lang-py --> works. is clearly a valid tag, so I'd expect both to work

This also would explain why questions tagged do not automatically use python syntax highlighting

marked as duplicate by Tim Stone, kiamlaluno, Danubian Sailor, yoozer8, Cody Gray Aug 17 '13 at 4:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • This is a duplicate. I can feel it. – Cole Johnson Aug 16 '13 at 10:13
  • 1
    python is associated with the default highlighter, not lang-py, so this behaviour is expected. Now, I don't know why python isn't associated with the lang-py highlighter, so that might be unintentional. – Tim Stone Aug 16 '13 at 14:17
  • ...Or not, Jeff seems to classify it as a "webby language", which means it gets the default highlighter. – Tim Stone Aug 16 '13 at 14:23
  • 1
    @TimStone: I don't think I've seen a single python question with an HTML block in. – Eric Aug 16 '13 at 14:37
  • Yeah, you might be able to make a case for having the associated highlighter changed. – Tim Stone Aug 16 '13 at 14:41
  • 4
    Python is so not a webby language. Jeff's assertion is way off the mark there. – Martijn Pieters Aug 16 '13 at 14:59
  • Hey, I can change that! Interesting. But is there another problem that changing it away from the default causes? The whole syntax highlighting system is hopelessly broken. – Ry- Aug 16 '13 at 15:08
  • 1
    @minitech: I am willing to find out! Change it, change it NAUOW! – Martijn Pieters Aug 16 '13 at 15:20
  • @MartijnPieters: Well, here we go! – Ry- Aug 16 '13 at 15:22
  • 1
    This is certainly not a dupe of the css-related one (stating that there css is used together with either html or javascript and therefore shouldn't cause confusion) - what other tags are usually used together with python that justify not having it default to lang-py? – Tobias Kienzler Aug 19 '13 at 6:58
  • @TobiasKienzler: Python-2.7, python-3.x, numpy, tkinter, to name but a few. – Martijn Pieters Aug 19 '13 at 8:56
  • 1
    @MartijnPieters ... "that justify not having it default to lang-py"? – Tobias Kienzler Aug 19 '13 at 8:59
  • @TobiasKienzler: The tags django, flask, zope, plone, web.py, and wsgi perhaps. – Martijn Pieters Aug 19 '13 at 9:00
  • @MartijnPieters I didn't exhaustively search, but on a quick glimpse I could not spot any post containing non-python code under these tags which actually "deserves" the tag python – Tobias Kienzler Aug 19 '13 at 9:12
  • Exactly; I am puzzled by why Jeff thought Python was a webby language deserving of not having the lang-py language highlighter applied by default. – Martijn Pieters Aug 19 '13 at 9:24

I changed it, as Python is really not a “web language”.

Let’s see what sort of horrible consequences arise… :(

Not the answer you're looking for? Browse other questions tagged .