String formatting with two dictionaries?

Carsten Gaebler clpy at snakefarm.org
Tue Oct 9 05:05:07 EDT 2001


Thanks for all the answers. Seems as if I hadn't been specific
enough about what I was looking for. It would be nice if there was
some builtin dictionary magic that would allow

"%(foo) %(bar)" % magic(dict1, dict2, ...)

where in case of duplicate keys the leftmost dictionary would be
preferred.

Perhaps the builtin dictionary() class could be extended so that
it accepts more than one dictionary argument?

cg.



More information about the Python-list mailing list