diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-11-13 18:43:24 -0800 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-11-13 18:44:16 -0800 |
commit | 1ae049b2ee257b0748abb0e2bcaef864622f0c82 (patch) | |
tree | d6e17a61f3b7bdc74c5fcf6463ade13b94397358 /sphinx/highlighting.py | |
parent | 45ad2e41a56a7fad0d9c3e8c32c54949c96bfa25 (diff) | |
download | sphinx-git-1ae049b2ee257b0748abb0e2bcaef864622f0c82.tar.gz |
Always prefer dict literals over calls to dict()
Dict literals are always slightly faster and are idiomatic modern
Python.
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r-- | sphinx/highlighting.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index b12fa6e2e..8bd12c991 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -38,15 +38,15 @@ if False: logger = logging.getLogger(__name__) -lexers = dict( - none = TextLexer(stripnl=False), - python = PythonLexer(stripnl=False), - python3 = Python3Lexer(stripnl=False), - pycon = PythonConsoleLexer(stripnl=False), - pycon3 = PythonConsoleLexer(python3=True, stripnl=False), - rest = RstLexer(stripnl=False), - c = CLexer(stripnl=False), -) # type: Dict[unicode, Lexer] +lexers = { + 'none': TextLexer(stripnl=False), + 'python': PythonLexer(stripnl=False), + 'python3': Python3Lexer(stripnl=False), + 'pycon': PythonConsoleLexer(stripnl=False), + 'pycon3': PythonConsoleLexer(python3=True, stripnl=False), + 'rest': RstLexer(stripnl=False), + 'c': CLexer(stripnl=False), +} # type: Dict[unicode, Lexer] for _lexer in lexers.values(): _lexer.add_filter('raiseonerror') |