From 4e860330f67b04bb5b0db7aee8586e269a7521aa Mon Sep 17 00:00:00 2001 From: "Eric V. Smith" Date: Sat, 19 Nov 2016 12:07:19 -0500 Subject: [PATCH] Note that literal closing curly braces must be doubled. --- pep-0498.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pep-0498.txt b/pep-0498.txt index d64a3afe1..0a446aa55 100644 --- a/pep-0498.txt +++ b/pep-0498.txt @@ -187,8 +187,10 @@ Once tokenized, f-strings are parsed in to literal strings and expressions. Expressions appear within curly braces ``'{'`` and ``'}'``. While scanning the string for expressions, any doubled braces ``'{{'`` or ``'}}'`` inside literal portions of an f-string are -replaced by the corresponding single brace. Doubled opening braces do -not signify the start of an expression. +replaced by the corresponding single brace. Doubled literal opening +braces do not signify the start of an expression. A single closing +curly brace ``'}'`` in the literal portion of a string is an error: +literal closing curly braces must be doubled ``'}}'``. The parts of the f-string outside of braces are literal strings. These literal portions are then decoded. For non-raw