Serhiy Storchaka added the comment:
In this example characters between percents are parsed as for any conversion
specifier but ignored and '%(a) %' is formatted to '%'. '(a)' specifies a
mapping key, ' ' is a conversion flag, the second '%' is a conversion type.
>>> '%(a) d' % {'a': 123}
' 123'
>>> '%(a) %' % {'a': 123}
'%'
This behavior is explicable but looks weird and errorprone. I'm not sure about
changing behavior in maintained branches (technically this may be not a bug),
but I think it is worth to make this an error in the developed branch.
----------
nosy: +benjamin.peterson, larry, ned.deily, rhettinger, serhiy.storchaka
versions: -Python 3.3, Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29568>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com