This is a package with preferences and syntax highlighter for cutting edge Python 3, although Python 2 is well supported, too. The syntax is compatible with Sublime Text, Atom and Visual Studio Code. It is meant to be a drop-in replacement for the default Python package. Attention VSCode users, MagicPython is used as the default Python highlighter in Visual Studio Code. Don't install it unless you want or need the cutting-edge version of it. You will likely see no difference because you're already using MagicPython. MagicPython correctly highlights all Python 3 syntax features, including type annotations, f-strings and regular expressions. It is built from scratch for robustness with an extensive test suite. Type hints in comments require support by the color scheme. The main motivation behind this package was the difficulty of using modern Python with other common syntax highlighters.
Features
- This is meant to be a drop-in replacement for the default Python package
- The package can be installed manually in all editors
- Annotations should not break the highlighting
- Various built-in types, classes, functions, as well as magic methods are all highlighted
- MagicPython highlights keywords when they are used as parameter/argument names
- Highlighting built-ins in class inheritance list makes it slightly more obvious where standard classes are extended