I have to solve this exercise:
Python's dictionaries do not preserve the order of inserted data nor store the data sorted by the key. Write an extension for the dict class whose instances will keep the data sorted by their key value. Note that the order must be preserved also when new elements are added.
and i'm freaking out.....i have some question:
1)It's the first time that i have to extend a class not written by me. This means that i don't know the code of the class DICT, how can i work on a class if i don't know how it's built ?Where can i find in linux the source file of the dict class?
2)Is the problem above difficult? Suggestions?