Comparing sequences with range objects
Antoon Pardon
antoon.pardon at vub.be
Thu Apr 7 07:18:19 EDT 2022
I am working with a list of data from which I have to weed out duplicates.
At the moment I keep for each entry a container with the other entries
that are still possible duplicates.
The problem is sometimes that is all the rest. I thought to use a range
object for these cases. Unfortunatly I sometimes want to sort things
and a range object is not comparable with a list or a tuple.
So I have a list of items where each item is itself a list or range object.
I of course could sort this by using list as a key function but that
would defeat the purpose of using range objects for these cases.
So what would be a relatively easy way to get the same result without wasting
too much memory on entries that haven't any weeding done on them.
--
Antoon Pardon.
More information about the Python-list
mailing list