[issue30590] str.format no longer accepts unpacked defaultdict for default values

2017-06-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There was a bug (see issue18531). It was fixed in 3.6.

Use str.format_map() for formatting with arbitrary mapping.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30590] str.format no longer accepts unpacked defaultdict for default values

2017-06-07 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30590] str.format no longer accepts unpacked defaultdict for default values

2017-06-07 Thread Carmen Bianca Bakker

New submission from Carmen Bianca Bakker:

As brief as can be, the following script works in Python 3.4 and Python 3.5:

from collections import defaultdict

mydict = defaultdict(lambda: 'default')

print('{foo}'.format(**mydict))

And prints "default".

In Python 3.6, you get a KeyError for foo.

--
components: Library (Lib)
messages: 295353
nosy: carmenbianca
priority: normal
severity: normal
status: open
title: str.format no longer accepts unpacked defaultdict for default values
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com