summaryrefslogtreecommitdiff
path: root/pygments/lexers/python.py
Commit message (Collapse)AuthorAgeFilesLines
* all: remove "u" string prefix (#1536)Georg Brandl2020-09-081-6/+6
| | | | | | | | | | | * all: remove "u" string prefix * util: remove unirange Since Python 3.3, all builds are wide unicode compatible. * unistring: remove support for narrow-unicode builds which stopped being relevant with Python 3.3
* all: use yield from (#1537)Georg Brandl2020-09-061-6/+4
|
* all: fixup remaining regexlint warningsGeorg Brandl2020-09-061-5/+5
|
* Update copyright year (fixes #1514.)Matthäus G. Chajdas2020-08-221-1/+1
|
* Add async and await keywords (#1507)Marius Hegele2020-08-171-1/+1
|
* Python 3: remove "cmp" builtinGeorg Brandl2020-05-081-1/+1
| | | | fixes #1444
* Merge pull request #1385 from tomerv/python-fstringMatthäus G. Chajdas2020-02-291-15/+106
|\ | | | | Python f-strings: highlight expressions in curly braces
| * Python f-strings: highlight expressions in curly bracesTomer Vromen2020-02-041-15/+106
| | | | | | | | Fixes #1228
* | Move Python 3-only exceptions into Python3LexerБорис Верховский2020-02-261-3/+3
|/
* Adds the walrus operator to the Python3 lexer.Brett Slatkin2020-02-021-1/+1
| | | | | | | - The walrus operator, also known as assignment expressions, was introduced in Python 3.8 - Moves the Token.Operator matching root above Token.Punctuation so the walrus operator takes precedence - Includes a test to make sure this behavior doesn't regress since it's sensitive to the order of expressions - Fixes #1381
* Python: recognize "f" string prefixGeorg Brandl2019-11-261-8/+10
| | | | Fixes #1156
* Python: make Python3 rules standaloneGeorg Brandl2019-11-261-231/+303
| | | | | As the language develops further, having to override more and more of the Python 2 lexer tokens makes no sense anymore.
* Python: make "python" shebang match Python 3Georg Brandl2019-11-261-2/+2
|
* Update project to use modern Python features and idiomsJon Dufresne2019-11-251-2/+2
| | | | | | | | | | Run the pyupgrade tool across the project to use modern language features. - Use set literals - Use dict comprehension - Remove unnecessary numeric indexes in format string - Remove unnecessary extra parentheses
* Python lexer: accept .jy filenamesGeorg Brandl2019-11-241-0/+2
| | | | Fixes #976
* Python lexers: make Python 3 the defaultGeorg Brandl2019-11-241-51/+78
|
* Python 3: add StopAsyncIteration exception (bitbucket PR #701)Georg Brandl2019-11-241-2/+3
|
* fixup! Treat Skylark/Starlark files as PythonRyan Beasley2019-11-221-0/+1
|
* Treat Skylark/Starlark files as PythonRyan Beasley2019-11-221-1/+17
| | | | | | | | Closes #1183. Testing Done: - `pygmentize -f html -O full foo.bzl > foo.html`; opened foo.html in a browser
* python3: make "import" in the "fromimport" context match the python2 behaviorKlaas van Schelven2019-11-151-1/+1
| | | | i.e. make it Keyword.Namespace
* Fixup all headers and some more minor problems.2.4.2Georg Brandl2019-05-281-2/+3
|
* Merged in ↵Anteru2018-12-071-17/+18
|\ | | | | | | | | | | cocoatomo/pygments-main-1/cocoatomo/insert-exception-names-added-in-python-v-1490751933833 (pull request #715) Insert exception names added in Python version 3.5 and 3.6.
| * Merge heads.Georg Brandl2018-11-281-10/+10
| |\
| | * Fix remaining 'DeprecationWarning: invalid escape sequence' occurrences in ↵Andreas Kloeckner2018-06-191-10/+10
| | | | | | | | | | | | lexer files
| * | Remove duplicated number definition.Matth?us G. Chajdas2018-11-271-14/+6
| | |
| * | Merged in kevinastone/pygments-main (pull request #720)Anteru2018-11-271-1/+1
| |\ \ | | | | | | | | | | | | Added pep 515 support to the python lexer
| | * | Highlight %a in Python3LexerPurpleMyst2017-07-231-1/+1
| | |/
| * | Fixed missing complex float caseKevin Stone2017-05-021-1/+1
| | |
| * | Added pep 515 support to the python lexerKevin Stone2017-05-021-0/+9
| |/ | | | | | | Fixes #1299
* | Insert exception names added in Python version 3.5 and 3.6.cocoatomo2017-03-291-3/+3
|/
* Copyright update.Georg Brandl2017-01-221-1/+1
|
* Add support for partials and path segments for Handlebars.Christian Hammond2016-11-041-0/+939
This introduces support for some missing features to the Handlebars lexer: Partials and path segments. Partials mostly appeared to work before, but the `>` in `{{> ... }}` would appear as a syntax error, as could other components of the partial. This change introduces support for: * Standard partials: `{{> partialName}}` * Partials with parameters: `{{> partialName varname="value"}}` * Ddynamic partials: `{{> (partialFunc)}}` * Ddynamic partials with lookups: `{{> (lookup ../path "partialName")}}` * Partial blocks: `{{> @partial-block}}` * Inline partials: `{{#*inline}}..{{/inline}}` It also introduces support for path segments, which can reference content in the current context or in a parent context. For instance, `this.name`, `this/name`, `./name`, `../name`, `this/name`, etc. These are all now tracked as variables.