[Python-Dev] PySequence_Concat for dicts (original) (raw)
Jared Flatow jflatow at northwestern.edu
Sat Jan 12 02:07:37 CET 2008
- Previous message: [Python-Dev] PySequence_Concat for dicts
- Next message: [Python-Dev] PySequence_Concat for dicts
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jan 11, 2008, at 6:45 PM, Raymond Hettinger wrote:
IMO, the chainmap() recipe on ASPN is a much better solution since it doesn't create a third dictionary with the all the attendant allocation and copying effort.
I wasn't suggesting that the result of concatenation would be a
chained table, rather that it would perform the equivalent of an
update and return the new dict (the same way extend works for lists).
It isn't a common use case to need to sum two dictionaries while keeping both of the inputs unaltered.
Inplace concatenation could be implemented more efficiently but would
be exactly the same as calling update.
jared
- Previous message: [Python-Dev] PySequence_Concat for dicts
- Next message: [Python-Dev] PySequence_Concat for dicts
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]