zlacker

[parent] [thread] 0 comments
1. earthb+(OP)[view] [source] 2007-07-07 22:55:31
For the record, in Python 3000, they're changing the printing and formatting around a lot, so the example above will become:

 "%s".format("a string")    #yields: a string
 "%s".format(["a string"])  #yields: ["a string"]
 "%s".format(("a string",)) #yields: ("a string",)
This will eliminate the confusing difference in the treatment of of tuples and lists when formatting a string. I think it's more clear, although I imagine some people will complain that "format" takes longer to type out than "%".
[go to top]