3 ms·
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") #yield
by earthboundkid 19y ago
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 "%".