> Antoine Pitrou wrote: >> >> Not to mention that e.g. "%r" % s is much simpler than "{0!r}".format(s) >> (if I got the format spec right). > > repr(s) is even simpler :) Yes, of course, but in the non-trivial case, e.g. "value=%r" % my_value, it's much easier to use %-style formatting than playing with repr() and the other string formatting facilities. > Note that the old code in this case wouldn't display dict or tuple > instances correctly. Avoiding that ambiguity is a major advantage of the > new approach. I know. For me the problem is not about ditching the % operator for an intuitively-named method like format(). It's the format syntax which has become much more complicated and error-prone without any clear advantage. Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4