New submission from wyz23x2 <wyz2...@163.com>:
In Python 3.8, `=` was added into f-strings: >>> a, b, c = 20, 40, 10 >>> f'{a+b-c=}' a+b-c=50 But if `20+40-10` is wanted, this needs to be written: >>> f'{a}+{b}-{c}={a+b-c}' 20+40-10=50 So something could be added. For example, `?` (this doesn't mean I recommend the question mark): >>> f'{a?+b?-c?=}' 20+40-10=50 >>> f'{a+b?-c=}' a+40-c=50 >>> f'{a+b-c=?}' # Suffix `=` to apply to all? 20+40-10 Suggestions? ---------- components: Interpreter Core messages: 389979 nosy: wyz23x2 priority: normal severity: normal status: open title: Improve `=` in f-strings type: enhancement versions: Python 3.10 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43695> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com