[Python-Dev] Multiple dicts for string interpolation?
Guido van Rossum
guido@CNRI.Reston.VA.US
Tue, 25 Jan 2000 23:13:28 -0500
> I'd like to propose a third alternative. How about if the string
> interpolation function accepted a tuple of dictionaries directly:
>
> s = format % (d1, d2)
>
> It would only be used when named interpolation was expected. I don't think
> there would be any conflict with current % operator semantics.
Gut feeling: it's dangerous to fill up every possible dark corner with
specific semantics that are occasionally useful, because if you go too
far you lose useful redundancy, and you end up with Perl.
Not sure whether this particular suggestion is "going too far."
I think it depends on to what extent this is a common, useful idiom.
Do you have evidence of that? Examples?
--Guido van Rossum (home page: http://www.python.org/~guido/)