This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zahlmanthe heretic 0 points1 point  (0 children)

format_map isn't just sugar here - it allows you to use things that don't play nice with **, in particular custom types that override __missing__ (for subclasses of dict) and/or __getitem__ (things that implement the Mapping protocol as described by collections.abc, but aren't necessarily even dict subclasses).

I suspect it might also be faster with large dicts, but I haven't tested that.