diff options
author | Eric V. Smith <ericvsmith@users.noreply.github.com> | 2019-05-08 20:28:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 20:28:48 (GMT) |
commit | 9a4135e939bc223f592045a38e0f927ba170da32 (patch) | |
tree | de347c6f2df801dc98b36ab5084dada335741517 /Include | |
parent | 65d98d0f53f558d7c799098da0abf376068c15fd (diff) | |
download | cpython-9a4135e939bc223f592045a38e0f927ba170da32.zip cpython-9a4135e939bc223f592045a38e0f927ba170da32.tar.gz cpython-9a4135e939bc223f592045a38e0f927ba170da32.tar.bz2 |
bpo-36817: Add f-string debugging using '='. (GH-13123)
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.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python-ast.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h index 0c739db..08d50ff 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -330,6 +330,7 @@ struct _expr { expr_ty value; int conversion; expr_ty format_spec; + string expr_text; } FormattedValue; struct { @@ -637,10 +638,10 @@ expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators, expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena); -#define FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) +#define FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7, a8) expr_ty _Py_FormattedValue(expr_ty value, int conversion, expr_ty format_spec, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); + string expr_text, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); #define JoinedStr(a0, a1, a2, a3, a4, a5) _Py_JoinedStr(a0, a1, a2, a3, a4, a5) expr_ty _Py_JoinedStr(asdl_seq * values, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena); |