Ammar Askar <am...@ammaraskar.com> added the comment:

Can re-create, this is because the **kwargs handling inside unicode format only 
performs a lookup when needed 
https://github.com/python/cpython/blob/c4cacc8c5eab50db8da3140353596f38a01115ca/Objects/stringlib/unicode_format.h#L393-L424
 and doesn't eagerly check it like here 
https://github.com/python/cpython/blob/ffd9753a944916ced659b2c77aebe66a6c9fbab5/Objects/call.c#L985-L1010

This might not be worth fixing though because of the very common pattern of 

  "{abcd}".format(**locals())

This would take a pretty dramatic performance hit for a relatively uncommon 
edge case.

----------
nosy: +ammar2, eric.smith, serhiy.storchaka, vstinner

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39694>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to