JitterMan <pythonb...@shalmirane.com> added the comment:
My expectation is that doubling up the braces acts to escape them, meaning that characters between the braces is treated as simple text and passed to the __format__ method as is. The only processing that should occur on the format specification is to convert the double braces to single braces. The fact that an error occurs saying that 'v' is not defined before the __format__ method is ever called indicates that the contents of the braces are being evaluated as an expression, which fails because v is not defined in the outer scope. Thus the f-string seems to be ignoring the escaping of the braces, but it only does so in the format specifier. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39601> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com