On Thu, Sep 19, 2019 at 3:08 PM Richard Higginbotham <higgi...@gmail.com> wrote: > > I'm not sure if there is any interest by others but I have frequently come > across cases where I would like to compare items in one list in another > similar to relational algebra. For example are the file names in A in B and > if so return a new list with those items. Long story short, I wrote some > functions to do that. They are quite simple and fast (due to timsort in no > small part). Even the plain python code is faster than the built in set > functions (afaik). I created a github and put the ones I thought the > community might like in there. https://github.com/ponderpanda/listex > > an example would be > a = [1,2,3,4,5,6] > b = [1,3,7,4] > list_intersection(a,b, sorta=True, sortb=True) > > returns [1,3,4]
Can you elaborate on how this differs from using the built-in set type for set operations? eg is this for situations where the values are not all hashable? ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RTNCLABG4YRN7KYF6M7VYT76L7KPMBFW/ Code of Conduct: http://python.org/psf/codeofconduct/