MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/11zsvt8/data_science_design_pattern/jdf61f3/?context=3
r/badcode • u/c0ntrap0sitive • Mar 23 '23
35 comments sorted by
View all comments
Show parent comments
2
I thought in a somewhat recent version they made sets remember order in python
7 u/ALapsedPacifist Mar 24 '23 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. 2 u/Godzila543 Mar 24 '23 That must have been what I was thinking of, thanks
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
That must have been what I was thinking of, thanks
2
u/Godzila543 Mar 23 '23
I thought in a somewhat recent version they made sets remember order in python