4 ms·
I have lived in Python ~80% of my career (~50% now) currently), although a large chunk of my career was writing 2.7 compatible with 2.6 (thanks RHEL). For the
by gshulegaard 7y ago
I have lived in Python ~80% of my career (~50% now) currently), although a large chunk of my career was writing 2.7 compatible with 2.6 (thanks RHEL). For the last year and a half I have written 3.6+ exclusively and I didn't realize that regular dicts were now ordered.
I don't use dicts if I require ordering, but if I did I would probably still reach for collections.OrderedDict...
I wonder what the implications are of dict ordering with the "new" (new for me...) function args and *kwargs...from the hip it sounds pretty handy.
- int_19h 7y agoThe implications are that now you get to see the order in which keyword args were specified by the caller. And in classes, you get to see the order in which attributes were defined. Both can come in very handy.
- BiteCode_dev 7y agoDict ordering started from the need to have class attributes, args and kwargs ordered if I recall.
- xapata 7y agoNo, that was a happy coincidence. The goal of the dict implementation was efficiency. Ordering was a side-effect.