On Fri, Oct 21, 2011 at 12:55 PM, Yingjie Lan <lany...@yahoo.com> wrote: > In simulation, one can use range objects to denote a discrete domain, > and domain comparison could be very useful. Not just equality, but also > things like if one domain is contained in another. >
Hmm. I wonder would slice objects be appropriate? They're comparable: >>> a=slice(1,10) >>> b=slice(1,10) >>> a==b True They're not iterable though - not directly (but you could slice range(maxint) down to size). You could possibly use itertools.islice objects for a similar job, but they're not comparable. ChrisA -- http://mail.python.org/mailman/listinfo/python-list