
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-09-03 13:24 byeric.smith, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 27948-1.diff | eric.smith,2016-09-07 13:56 | review | ||
| 27948-2.diff | eric.smith,2016-09-09 11:17 | review | ||
| Messages (5) | |||
|---|---|---|---|
| msg274294 -(view) | Author: Eric V. Smith (eric.smith)*![]() | Date: 2016-09-03 13:24 | |
Seeissue 27921.Currently (and for 3.6 beta 1), backslashes are not allowed anywhere in f-strings. This needs to be changed to allow them in the string parts, but not in the expression parts.Also, require that the start and end of an expression be literal '{' and '}, not escapes like '\0x7b' and '\u007d'. | |||
| msg274811 -(view) | Author: Eric V. Smith (eric.smith)*![]() | Date: 2016-09-07 13:56 | |
This patch implements the new logic. It passes all of the fstring tests (except of course the ones that had backslashes in the expressions). I'd still like to add some more tests, because I'm not convinced the named unicode escapes are correct (f"\N{LEFT CURLY BRACE}". Because I'm now scanning the decoded utf-8 version of the string, I need to be aware of this syntax and not decide it's part of an expression (because of the braces). | |||
| msg275309 -(view) | Author: Eric V. Smith (eric.smith)*![]() | Date: 2016-09-09 11:17 | |
Updated patch, works against HEAD. I added a few tests and tweaked some comments. My goal is to commit this today, before the 3.6b1 cutoff. I don't think there's much risk to it.I still need to update the PEP. | |||
| msg275540 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-09-10 01:56 | |
New changesetb3ac1e154cdd by Eric V. Smith in branch 'default':Issue 27948: Allow backslashes in the literal string portion of f-strings, but not in the expressions. Also, require expressions to begin and end with literal curly braces.https://hg.python.org/cpython/rev/b3ac1e154cdd | |||
| msg275541 -(view) | Author: Eric V. Smith (eric.smith)*![]() | Date: 2016-09-10 01:59 | |
I've fixed the code and fixed/added tests. I still need to update the docs andPEP 498. I'll create a separate issue for the docs, once I'm done with the PEP. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:35 | admin | set | github: 72135 |
| 2016-09-19 08:56:02 | flying sheep | set | nosy: +flying sheep |
| 2016-09-10 01:59:14 | eric.smith | set | status: open -> closed resolution: fixed messages: +msg275541 stage: patch review -> resolved |
| 2016-09-10 01:56:26 | python-dev | set | nosy: +python-dev messages: +msg275540 |
| 2016-09-09 11:17:11 | eric.smith | set | files: +27948-2.diff messages: +msg275309 |
| 2016-09-07 15:01:19 | serhiy.storchaka | set | nosy: +serhiy.storchaka |
| 2016-09-07 13:56:20 | eric.smith | set | stage: needs patch -> patch review |
| 2016-09-07 13:56:03 | eric.smith | set | files: +27948-1.diff keywords: +patch messages: +msg274811 |
| 2016-09-03 13:24:05 | eric.smith | create | |