I created an answer here: https://stackoverflow.com/a/11934671/1442342
But the Python syntax is not highlighting.
Does the tag python-2.7 not give a highlighting hint or have I done something wrong?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.Sign up to join this community
Apparently not; I've added the python tag to the question and the code highlighting is now working.
I've also removed the python-2.7 tag from that question though, it is not the right tag for the question.
For future reference, you can also mark your code blocks with an explicit code hint:
<!-- language: lang-py -->
See How do I format my code blocks? for details.
The reason is that the version-specific tags need to be explicitly added by the admins/mods in order to pick up syntax highlighting for the base language, in cases where the base tag (or any other tag that defaults to the same language) is not included. I complained about this for SQL Server 2008 R2 and SQL Server 2012:
The general solution going forward seems to be to add explicit version tags to the syntax highlighter as they come out, rather than solve for all potential versions using regex or wildcards. Which I think is more scalable but seems to be opposed.