GIGO: words unreadable aloud
Mishrogo Weedapeval
 

 

  Tuesday 4 November 2003
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   comment/     



Click here to visit the Radio UserLand website. Click to see the XML version of this web page. © Copyright 2007 Doug Landauer .
Last update: 07/2/6; 12:35:01 .
Click here to send an email to the editor of this weblog.

November 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
Oct   Dec

Previous/Next