| 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) (GH-30866)
* 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>
|
| |
|
|
|
|
|
| |
if inside parentheses. (GH-29767)
Backport of GH-29757
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
| |
|
|
|
|
|
| |
and repeated expressions (GH-27729) (GH-27743)
(cherry picked from commit 8e832fb2a2cb54d7262148b6ec15563dffb48d63)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-43797: Improve syntax error for invalid comparisons
* Update Lib/test/test_fstring.py
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* Apply review comments
* can't -> cannot
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Fix test_float
* Fix _osx_support
* Fix test_fstring
* Fix test_gc
* Fix test_gzip
* Fix test_hashlib
* Fix unrelated whitespace issue
Co-authored-by: Ned Deily <nad@python.org>
|
| |
|
|
| |
(GH-25006)
|
| |
|
|
| |
newlines (GH-24279)
|
| |
|
| |
Automerge-Triggered-By: GH:isidentical
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
in format specifier (GH-22036)
* Fixed `f-string/str.format` error description when using two `,` in format specifier.
Co-authored-by: millefalcon <hanish0019@hmail.com>
|
| | |
|
| |
|
|
|
| |
(GH-21084)
Prefix the error message with `fstring: `, when parsing an f-string expression throws a `SyntaxError`.
|
| |
|
|
| |
characters. (GH-21035)
|
| |
|
| |
This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
|
| |
|
|
| |
statements with no value (GH-20701)
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
(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.
|