[Python-Dev] Multiple dicts for string interpolation?
Jack Jansen
jack@oratrix.nl
Wed, 26 Jan 2000 10:56:18 +0100
> the part you didn't like about that? If so, how about changing the
> constructor to
>
> def __init__(self, *dicts):
> ...
>
> instead so you could use it as a one-liner
>
> format % MultiDict(d1, d2, ...)
>
> ? That's exactly the same as the tuple idea, except there's a nice
> descriptive word in the middle of it <wink>.
I've always wonderer why dict+dict isn't supported (or possibly dict|dict, if
the key-collision semantics of + on dict are seen as a problem). Is there a
good reason for this, or is it just that there are other more important things
to implement?
This wouldn't be a replacement for all uses of MultiDict, as it would probably
have to create a new dict to keep semantics in line with those of list+list
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm