Dictionary inversion in Smalltalk, C#, and Python
James Robertson, the Cincom Smalltalk guy,
compares dictionary inversion
in Smalltalk versus a verbose C# example. (To be fair, the comments
point out that the C# example was intended to show
the .NET reflection APIs rather than to be compact).
Had to write it in Python anyway:
e = {}
for k,v in d.items(): e[v] = k
For what that's worth.
4:42:42 PM