On Wed, 2004-08-11 at 08:21, Andrew Durdin wrote: > Forgive me for being obtuse, but I can't see anything significantly > simpler in this PEP than the standard string interpolation, except for > the case where the identifier doesn't need braces: > > template("Hello, $name, how are you?") % {name: "Jim"} > versus > "Hello, %(name)s, how are you?") % {name: "Jim"} > > Apart from removing the need for the parentheses/braces in this case, > all it does is consistently remove the "s", and replace the % with $, > and then limiting the interpolated values to strings (or will it > automatically use str(x) for any non-string variable x?). > Is there any other benefit to this that I'm overlooking? The elimination of the trailing 's' is definitely a benefit, as is the adoption of $-placeholders, since that tends to be the placeholder introducing character in many other languages. In terms of usability, it's a win. -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 307 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/python-dev/attachments/20040811/9ab236ac/attachment.pgp
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