Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
New Python 3.0 string formatting - really necessary?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Arnaud Delobelle, post: 3705811"] Well that's easy. I see 'r' didn't answer so I will: only accept tuples on the right hand side of the %, so all arguments have to be put inside a tuple. Traceback (most recent call last): '42' Of course there would still be the possibility of uncaught bugs when people forget to put the argument in a tuple if the argument itself is a tuple of length 1. .... print "foo(%s)" % x .... # should be % (x,) .... foo(1) That's why .format() is a better option IMHO. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
New Python 3.0 string formatting - really necessary?
Top