Hacker News new | ask | show | jobs
by gen220 992 days ago
`kwargs.pop`, what a phrase – it's amazing how the right arrangement of syllables can make your brain shudder. (:
1 comments

Well, who hasn’t used that classic datastructure `dictstack` (and famously the dict.pop operation)?

At first I was kinda giggling. But actually there are such things, if the Mapping is also ordered.

LRU cache, trees, tries… and—oh wait—all CPython dicts are ordered these days!

(Honestly I have only used the modern ordered-nature of `dict` for serialization to versioned or human-editable files. But why not an algorithm with a “`stackdict`” I guess?)