Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-11-14 05:43:24 +0300
committerJon Dufresne <jon.dufresne@gmail.com>2018-11-14 05:44:16 +0300
commit1ae049b2ee257b0748abb0e2bcaef864622f0c82 (patch)
treed6e17a61f3b7bdc74c5fcf6463ade13b94397358 /sphinx/highlighting.py
parent45ad2e41a56a7fad0d9c3e8c32c54949c96bfa25 (diff)
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.py18
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')