Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
An Ordered Set for Python? (lwn.net)
2 points by signa11 on Nov 4, 2022 | hide | past | favorite | 1 comment


I've come up against this weirdness with sets. I often like to use sets to get access to the 'intersection' function.

The trick I tend to like to do, use a dict with an index of your own. There you go, ordered set.

You have to build your own stuff around it and pull and push data annoyingly but you do get effectively an ordered set.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: