New submission from Greg Jednaszewski <jednaszew...@gmail.com>: Found on 2.6.2 and 2.6.4:
I expect that printing an uninitialized variable from a defaultdict should work. In fact it does with old-style string formatting. However, when you try to do it with new-style string formatting, it raises a KeyError. >>> import collections >>> d = collections.defaultdict(int) >>> "{foo}".format(d) Traceback (most recent call last): File "<stdin>", line 1, in <module> KeyError: 'foo' >>> "%(foo)d" % d '0' ---------- components: Library (Lib) messages: 101025 nosy: jednaszewski severity: normal status: open title: collections.defaultdict gives KeyError with format() type: behavior versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8134> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com