Hacker Newsnew | comments | ask | jobs | submitlogin
earthboundkid 1587 days ago | link | parent

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 "%".



Lists | RSS | Bookmarklet | Guidelines | FAQ | News News | Feature Requests | Y Combinator | Apply | Library

Search: