class SortedKeyDict(dict): def keys(self): return sorted(super( SortedKeyDict, self).keys())d = SortedKeyDict((('A', 67), ('B', 68),('C', 2)))print 'By iterator:'.ljust(12), [key for key in d]print 'By keys():'.ljust(12), d.keys()
Name (required)
email (will not be published) (required)
Website