Barry Warsaw wrote: > On Tue, 2006-04-04 at 14:28 +1200, Greg Ewing wrote: > >>I'm also not all that keen on $, either inside >>or outside the string. It seems to me that >>something like >> >> "User {user} has printed {n} pages" >> >>sets off the parameters from the rest of the >>string more readably than >> >> "User $user has printed $n pages" > > > Here i disagree. $-strings are so familiar to people coming from other > languages that they instantly "get it".
I'm more interested in long-term readability and maintainability than in pandering to one-off impressions when coming from another language. I don't believe they would have any difficulty "getting" this, anyway. Can you honestly say that if you saw something like subst("User {user} has printed {n} pages", user = user_code, n = page_count) you wouldn't instantly figure out what was going on? There are other problems with the $ syntax too. The lack of an explicit closing marker causes problems when the parameter is immediately followed in the string by an alphanumeric character. You end up having to allow some kind of bracketing as an optional extra anyway, such as subst("I'm a ${what}spotter", what = "train") Seems to me it's simpler as well as clearer to just make the syntax fully bracketed in the first place. -- Greg _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com