Brace matching works when a Python function call is inside an fstring when it's all on one line: msg = f"{prefix}{pformat(resp.json().get('message'), indent=1, sort ...
Python f-string is the newest Python syntax to do string formatting. It is available since Python 3.6. Python f-strings provide a faster, more readable, more concise ...