[Tutor] Another __builtins__.__dict__ question

alan.gauld@bt.com alan.gauld@bt.com
Tue Dec 10 06:12:02 2002


> __builtins__.__dict__.keys().sort()
> 
> returns nothing.

Unfortunately sort() sorts the list in place but dsoesn't return a 
reference to the sorted list. You have to do something like:

keys = __builtins__.__dict__.keys()
keys.sort()
print keys


HTH,

Alan G.