Re:Python 3.12
by b33j0r on Monday October 02, 2023 @03:56PM
(#37743611)
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?)
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?)