[New-bugs-announce] [issue3516] string formatting quirk using %.%

nadav report at bugs.python.org
Thu Aug 7 15:33:06 CEST 2008

New submission from nadav <blop.blopy at gmail.com>:

>>> "%.%s" % ()
>>> "%(a).%(b)s" % dict(a=2)
>>> "%(a).%(b)s" % dict(a=2, b=3)
>>> "%(a).%(b)s" % dict()
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in -toplevel-
    "%(a).%(b)s" % dict()
KeyError: 'a'

this is counter intuitive and cannot be deduced from the documentation.

components: Interpreter Core
messages: 70822
nosy: blop
severity: normal
status: open
title: string formatting quirk using %.%
type: behavior

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list