| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
character if the f-string is missing a trailing right brace. (GH-31365)
(cherry picked from commit ffd9f8ff84ed53c956b16d027f7d2926ea631051)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
sequences in f-strings. (GH-30865) (30867)
* bpo-46503: Prevent an assert from firing. Also fix one nearby tiny PEP-7 nit.
* Added blurb.
(cherry picked from commit 0daf72194bd4e31de7f12020685bb39a14d6f45e)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
|
|
|
| |
and repeated expressions (GH-27729) (GH-27744)
(cherry picked from commit 8e832fb2a2cb54d7262148b6ec15563dffb48d63)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
|
|
|
| |
constructs (GH-24591)
|
|
|
|
|
|
|
| |
(GH-24067) (GH-24069)
(cherry picked from commit bd2728b1e8a99ba8f8c2d481f88aeb99b8b8360f)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(GH-22060)
(cherry picked from commit 749ed85e4446f548e22934931241f644a33d81ce)
Co-authored-by: han-solo <hanish0019@gmail.com>
Co-authored-by: han-solo <hanish0019@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
in format specifier (GH-22036) (GH-22041)
* Fixed `f-string/str.format` error description when using two `,` in format specifier.
Co-authored-by: millefalcon <hanish0019@hmail.com>
(cherry picked from commit 0d6aa7f0ee38eb453bc8f73bf4830e6172be2f35)
Co-authored-by: han-solo <hanish0019@gmail.com>
Co-authored-by: han-solo <hanish0019@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
(GH-21084)
Prefix the error message with `fstring: `, when parsing an f-string expression throws a `SyntaxError`.
(cherry picked from commit 2e0a920e9eb540654c0bb2298143b00637dc5961)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
|
|
|
|
|
| |
characters. (GH-21035). (GH-21156)
(cherry picked from commit 700cfa8c90a90016638bac13c4efd03786b2b2a0)
|
|
|
|
|
|
|
| |
statements with no value (GH-20701)
(cherry picked from commit 972ab0327675e695373fc6272d5ac24e187579ad)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-20399) (GH-20404)
When a `SyntaxError` in the expression part of a fstring is found,
the filename attribute of the `SyntaxError` is always `<fstring>`.
With this commit, it gets changed to always have the name of the file
the fstring resides in.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>.
(cherry picked from commit f7b1e461567e5e3fa3ba46f589d9edc1b45b2dd0)
|
| |
|
|
|
|
| |
(GH-20033)
|
|
|
|
| |
Due to backwards compatibility concerns regarding keywords immediately followed by a string without whitespace between them (like in `bg="#d00" if clear else"#fca"`) will fail to parse,
commit 41d5b94af44e34ac05d4cd57460ed104ccf96628 has to be reverted.
|
| |
|
|
|
| |
`JoinedStr`s and `FormattedValue also needs to be shifted, in order to correctly compute the location information of nested f-strings.
|
|
|
|
|
|
|
|
|
|
|
| |
* Rename PyConfig.use_peg to _use_peg_parser
* Document PyConfig._use_peg_parser and mark it a deprecated
* Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated
in the documentation.
* Add use_old_parser() and skip_if_new_parser() to test.support
* Remove sys.flags.use_peg: use_old_parser() uses
_testinternalcapi.get_configs() instead.
* Enhance test_embed tests
* subprocess._args_from_interpreter_flags() copies -X oldparser
|
|
|
|
| |
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
|
|
|
|
|
|
|
| |
(GH-19521)
When there is a SyntaxError after reading the last input character from
the tokenizer and if no newline follows it, the error message used to be
`unexpected EOF while parsing`, which is wrong.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
| |
failure (GH-13256)
|
|
|
| |
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.
|
| |
|
|
|
|
| |
f-string. (GH-11161)
|
| |
|
|
|
|
| |
for invalid escape sequences in string and bytes literals.
|
| |
|
|
|
| |
For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly.
|
|
|
|
|
|
| |
(#2232)
This caused a segfault on eval("f'\\\n'") and eval("f'\\\r'") in debug build.
|
|
|
|
|
|
|
|
| |
(#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.
|
| |
|
|
|
|
| |
by ast.literal_eval() even if they do not include subexpressions.
|
| |
|
|
|
|
| |
expressions that clearly are not evaluated.
|
|
|
|
| |
literal and thus triggers the single closing brace error, clarifying #28590.
|
|
|
|
| |
test_parens_in_expressions, but because the newline is not a literal newline, but a backslash en, this error is triggered.
|
| |
|
|
|
|
| |
right place.
|
| |
|
|
|
|
| |
but not in the expressions. Also, require expressions to begin and end with literal curly braces.
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
being corrupted if an error occurred in PyObject_Format().
|
| |
|