How to identify which numbers in a list are within each others' range

Paul Rubin http
Thu Jan 31 18:09:03 EST 2008


"attn.steven.kuo at gmail.com" <attn.steven.kuo at gmail.com> writes:
> mysets = [set(range(x[2],x[1])) for x in mylist]

This is pretty horrible, each set can be arbitrarily large,
i.e. if x[2] and x[1] are 0 and 1000000, you get a set with
a million elements.  



More information about the Python-list mailing list