wyz23x2 <wyz2...@163.com> added the comment:

Q: Why not use f"{var:,}".replace(',', sepchar) for the sepchar parameter?
A: It is very complicated in the case below:
num = 1234567
text = 'Hello, world!'
print(f"{num:,}{text}").replace(',', ' ') # Becomes '1 234 567Hello world!'
print(f"{f'{num:,}'.replace(',', ' ')}{text}") # Too complicated!
print(f"{num:,}".replace(',', ' ')+text) # Slow!

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41250>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to