On 05/06/2008, Steven D'Aprano <steve at pearwood.info> wrote: > Yes, I don't particularly see the advantage of writing: > > "spam %s spam" % (value,) > > over > > "spam %s spam" % value > > Why require the first version? Because the second breaks if value is a tuple: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> value = (1,2) >>> "spam %s spam" % value Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: not all arguments converted during string formatting Paul.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4