summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fstring.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32912: Revert SyntaxWarning on invalid escape sequences. (GH-15195)Gregory P. Smith2019-08-101-1/+1
| | | | | | | | | | | | | | | | | | DeprecationWarning will continue to be emitted for invalid escape sequences in string and bytes literals just as it did in 3.7. SyntaxWarning may be emitted in the future. But per mailing list discussion, we don't yet know when because we haven't settled on how to do so in a non-disruptive manner. (Applies 4c5b6bac2408f879231c7cd38d67657dd4804e7c to the master branch). (This is https://github.com/python/cpython/pull/15142 for master/3.9) https://bugs.python.org/issue32912 Automerge-Triggered-By: @gpshead
* Fix typos in docs, comments and test assert messages (#14872)Min ho Kim2019-07-211-1/+1
|
* bpo-37050: Remove expr_text from FormattedValue ast node, use Constant node ↵Eric V. Smith2019-05-271-0/+18
| | | | | instead (GH-13597) When using the "=" debug functionality of f-strings, use another Constant node (or a merged constant node) instead of adding expr_text to the FormattedValue node.
* bpo-36817: Do not decrement reference for expr_text on fstring = parsing ↵Pablo Galindo2019-05-121-0/+2
| | | | failure (GH-13256)
* bpo-36817: Add f-string debugging using '='. (GH-13123)Eric V. Smith2019-05-081-0/+109
| | | If a "=" is specified a the end of an f-string expression, the f-string will evaluate to the text of the expression, followed by '=', followed by the repr of the value of the expression.
* bpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021)Anthony Sottile2019-01-131-19/+13
|
* bpo-35494: Improve syntax error messages for unbalanced parentheses in ↵Serhiy Storchaka2019-01-121-13/+23
| | | | f-string. (GH-11161)
* bpo-33306: Improve SyntaxError messages for unbalanced parentheses. (GH-6516)Serhiy Storchaka2018-12-171-4/+8
|
* bpo-32912: Replace a DeprecationWarning with a SyntaxWarning (GH-9652)Serhiy Storchaka2018-10-191-1/+1
| | | | for invalid escape sequences in string and bytes literals.
* bpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445)Serhiy Storchaka2018-09-271-8/+16
|
* bpo-30465: Fix lineno and col_offset in fstring AST nodes (#1800)Łukasz Langa2017-09-071-0/+248
| | | For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly.
* bpo-30682: Removed a too-strict assertion that failed for certain f-strings. ↵ericvsmith2017-06-161-0/+6
| | | | | | (#2232) This caused a segfault on eval("f'\\\n'") and eval("f'\\\r'") in debug build.
* bpo-30529: Fix errors for invalid whitespaces in f-string subexpressions. ↵Serhiy Storchaka2017-06-081-0/+10
| | | | | | | | (#1888) 'invalid character in identifier' now is raised instead of 'f-string: empty expression not allowed' if a subexpression contains only whitespaces and they are not accepted by Python parser.
* bpo-29104: Fixed parsing backslashes in f-strings. (#490)Serhiy Storchaka2017-05-251-0/+14
|
* Issue #28739: f-string expressions no longer accepted as docstrings andSerhiy Storchaka2016-12-111-10/+10
| | | | by ast.literal_eval() even if they do not include subexpressions.
* Fixed issue #28633: segfault when concatenating bytes literal and f-string.Eric V. Smith2016-11-071-0/+7
|
* Update test_no_escapes_for_braces to clarify behavior with a docstring and ↵Jason R. Coombs2016-11-061-5/+8
| | | | expressions that clearly are not evaluated.
* Additionally show that a backslash-escaped opening brace is treated as a ↵Jason R. Coombs2016-11-061-0/+1
| | | | literal and thus triggers the single closing brace error, clarifying #28590.
* Add an additional test with a newline, one that's very similar to ↵Jason R. Coombs2016-11-061-0/+1
| | | | test_parens_in_expressions, but because the newline is not a literal newline, but a backslash en, this error is triggered.
* Update the f-string test broken in issue #28385.Serhiy Storchaka2016-10-311-1/+1
|
* Add another f-string comment test, to make sure # are being caught in the ↵Eric V. Smith2016-09-111-0/+2
| | | | right place.
* Make an f-string error message more exact and consistent.Eric V. Smith2016-09-111-1/+2
|
* Issue 27948: Allow backslashes in the literal string portion of f-strings, ↵Eric V. Smith2016-09-101-46/+86
| | | | but not in the expressions. Also, require expressions to begin and end with literal curly braces.
* Closes issue 27921: Disallow backslashes anywhere in f-strings. This is a ↵Eric V. Smith2016-09-031-91/+51
| | | | temporary restriction. In 3.6 beta 2, the plan is to again allow backslashes in the string parts of f-strings, but disallow them in the expression parts.
* Issue #27626: Further spelling fixes for 3.6Martin Panter2016-07-281-1/+1
|
* Fix issue 26287: While handling FORMAT_VALUE opcode, the top of stack was ↵Eric V. Smith2016-02-051-0/+11
| | | | being corrupted if an error occurred in PyObject_Format().
* f-strings: More tests for empty expressions along with missing closing braces.Eric V. Smith2015-09-231-0/+7
|
* Added more f-string test for empty expressions.Eric V. Smith2015-09-231-0/+3
|
* Move f-string compilation of the expression earlier, before the conversion ↵Eric V. Smith2015-09-231-0/+9
| | | | character and format_spec are checked. This allows for error messages that more closely match what a user would expect.
* Issue #24965: Implement PEP 498 "Literal String Interpolation". ↵Eric V. Smith2015-09-191-0/+715
Documentation is still needed, I'll open an issue for that.