This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Akos Kiss, ammar2, eric.smith, serhiy.storchaka, vstinner
Date 2020-02-20.14:16:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1582208176.47.0.37195478105.issue39694@roundup.psfhosted.org>
In-reply-to
Content
See similar issue for SimpleNamespace: https://bugs.python.org/issue31655.

We should add a similar check in str.format(). Accepting a non-string keys is an implementation detail. There is no guarantee that it works in other implementations.

It should not hit performance, because the kwargs dict is usually small, the check is cheap, and formatting itself can be expensive. For the case when you need to pass a huge dict and use only few items from it, you can use str.format_map().
History
Date User Action Args
2020-02-20 14:16:16serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, eric.smith, ammar2, Akos Kiss
2020-02-20 14:16:16serhiy.storchakasetmessageid: <1582208176.47.0.37195478105.issue39694@roundup.psfhosted.org>
2020-02-20 14:16:16serhiy.storchakalinkissue39694 messages
2020-02-20 14:16:16serhiy.storchakacreate