[Python-3000] String formating operations in python 3k (original) (raw)
Bill Janssen janssen at parc.com
Wed Apr 5 05:12:57 CEST 2006
- Previous message: [Python-3000] String formating operations in python 3k
- Next message: [Python-3000] String formating operations in python 3k
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
+1 for {} over the ///{} dichotomy -- it's easier to explain, as well as more readable.
Perhaps I'm just allergic to bash/perl/java/ruby syntax, but the more I follow this discussion, the more I like the current string formatting system :-).
It seems to me that the core of the issue is the current insistence, with %(NAME)FORMAT, on a trailing format type which is frequently forgotten. Why not just remove that insistence, and use %(foo) in py3k? Code will break, sure, but we're going to expect that. If you really need to control the presentation, put that information inside the parens, as in %(foo:.3f). But let it default to "s".
There are other issues, such as the need to construct a dictionary, for which reasonable approaches have been offered over the last week.
Bill
- Previous message: [Python-3000] String formating operations in python 3k
- Next message: [Python-3000] String formating operations in python 3k
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]