Yo All!

Yet another undocumented Python failure:

i>>> d = {}
>>> d[1] = "one"
>>> d[2] = "two"
>>> str(d[2])
'two'
>>> echo "%s(d[2])s" % locals
  File "<stdin>", line 1
    echo "%s(d[2])s" % locals
                   ^
SyntaxError: invalid syntax


Python says %s(x)s works for any x that str(x) works.

Here is the Python doc:

https://docs.python.org/2.7/library/stdtypes.html#string-formatting

"'s'    String (converts any Python object using str())."

WRONG!

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        g...@rellim.com  Tel:+1 541 382 8588

Attachment: pgpGAwwVttFBr.pgp
Description: OpenPGP digital signature

_______________________________________________
devel mailing list
devel@ntpsec.org
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to