On 2018-04-18, tejaswi prakash <tejaswidprak...@gmail.com> wrote: > Hello all, > I have 3 continuous (steps of 1) ranges a,a1,a2. All of them sorted. > I am performing the following operations on them > > a = a.difference (a1) > a = a.difference(a2)
If they are each stored as a set I don't see how they can be sorted. Are you converting to set and then calling difference? It may still be more efficient than writing your own loop to take advantage of the sorted status of the original objects. -- Neil Cerutti -- https://mail.python.org/mailman/listinfo/python-list