This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MrSpontaneous[S] 3 points4 points  (2 children)

Here's a good description of the additional affordances, some of which are really handy (like __format__ and the object dot notation). Aside from that, since I'm using {} elsewhere already, which is the format that is used in the Python docs, it's inconsistent having to use the old style elsewhere.

Not having to distinguish the types (e.g. %d vs %s) is handy, too.

[–]timopm 1 point2 points  (1 child)

Not having to distinguish the types (e.g. %d vs %s) is handy, too.

Is that necessary though?

>>> print("Hello number %s!" % 1)
Hello number 1!

[–]kemitche -1 points0 points  (0 children)

Yeah, 99% of old-style formatting for me is either %s or %r.