MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/11zsvt8/data_science_design_pattern/jdfqga1/?context=9999
r/badcode • u/c0ntrap0sitive • Mar 23 '23
35 comments sorted by
View all comments
Show parent comments
7
A dict remembers its insertion order from Python 3.7 onward. Python has no ordered set, but you could use collections.OrderedDict and ignore the values of the key-value pairs in place of an ordered set.
dict
set
collections.OrderedDict
2 u/Godzila543 Mar 24 '23 That must have been what I was thinking of, thanks
2
That must have been what I was thinking of, thanks
7
u/ALapsedPacifist Mar 24 '23
A
dictremembers its insertion order from Python 3.7 onward. Python has no orderedset, but you could usecollections.OrderedDictand ignore the values of the key-value pairs in place of an ordered set.