In Gedit, which syntax highlighting option is for Python 3.x?

Gedit has two options for syntax highlighting for Python:

  • Python
  • Python2

Is the "Python" option for:

  1. Older versions of Python less than version 2 (ex. 1.6, 1.5, ...)

    ...or...

  2. Newer versions of Python greater than version 2 (ex. 3.0, 3.1, 3.9, ...)

In other words, to do syntax highlighting for Python 3.9, which of the two options should I select?

I am using Gedit version 40.1-1 in Ubuntu 21.10. Here is a screenshot of Gedit's syntax highlighting options menu:

Gedit Syntax Highlighting Options Menu


Solution 1:

Aside from Python 1.x being completely irrelevant these days (do you expect the "Python console" in gedit to run Python 1?), if you need confirmation, here's the defining line for "Python" in the GtkSourceView source code:

<language id="python3" name="Python" version="2.0" _section="Script">

GtkSourceView is the library used by gedit for syntax highlighting.