[Python-ideas] Make range objects orderable

Riley Banks waultah at gmail.com
Fri Apr 24 00:21:45 CEST 2015


I propose adding the ability to compare range objects using methods (e.g.
range.issubrange) and/or regular operators. Example:

    In [56]: range(0, 10, 3).issubrange(range(10))
    Out[56]: True

    In [57]: range(0, 10, 3) <= range(10)
    Out[57]: True

    In [58]: range(10) <= range(0, 10, 3)
    Out[58]: False

I'll write a patch if you decide that this idea is worth implementing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150423/9dcf5335/attachment.html>


More information about the Python-ideas mailing list