jakevdp / WhirlwindTourOfPython

The Jupyter Notebooks behind my OReilly report, "A Whirlwind Tour of Python"
Creative Commons Zero v1.0 Universal
3.7k stars 1.61k forks source link

Change statement about dictionaries? #6

Open cdeil opened 7 years ago

cdeil commented 7 years ago

Currently you have this statement about Python dictionaries:

http://nbviewer.jupyter.org/github/jakevdp/WhirlwindTourOfPython/blob/master/06-Built-in-Data-Structures.ipynb#Dictionaries

Keep in mind that dictionaries do not maintain any sense of order for the input parameters; this is by design. This lack of ordering allows dictionaries to be implemented very efficiently, so that random element access is very fast, regardless of the size of the dictionary (if you're curious how this works, read about the concept of a hash table).

Now that Python 3.6 has ordered and more efficient dictionaries, this statement should be changed, no? Maybe re-word the existing sentence starting with "This lack ..." or add a new one pointing to e.g. https://docs.python.org/3/whatsnew/3.6.html#new-dict-implementation ?

jakevdp commented 7 years ago

Good point! I'll think about how I want to address this...