This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author shoark7
Recipients docs@python, shoark7
Date 2019-03-20.02:30:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553049009.71.0.761140685062.issue36377@roundup.psfhosted.org>
In-reply-to
Content
Hi, I have lots of interests in python data structures and their inheritance relationships so I often look around in python collections and collections.abc module.

```
https://docs.python.org/3/tutorial/datastructures.html#comparing-sequences-and-other-types
```

Please see the last section of the page. I know all Python users are well aware of Sequence comparisons like in tuples and list. This page also mentions that 

'Sequence objects may be compared to other objects with the same sequence type' in the very first line of the page.

However, we have to know that 'range' is also a subclass of 'Sequence' but 'range' objects are not comparable to each other.

I tested 'range(1, 3) < 'range(3)' in my interpreter. If it compares correctly as both are same Sequence types, result would be 'False'. Instead, TypeError was raised. It's because comparision methods(__gt__, __lte__, etc) are not impleneted here. I thought range objects would compare the values with peeking. But they don't. 


So, I recommend you to implement 5.8 section in this page as follows:
  
   -> Please specify that 'not all' Sequence subclass are comparable to the same classes: typically, 'range'.

'range' is a good example because every Python user uses 'range' in for loop.
History
Date User Action Args
2019-03-20 02:30:09shoark7setrecipients: + shoark7, docs@python
2019-03-20 02:30:09shoark7setmessageid: <1553049009.71.0.761140685062.issue36377@roundup.psfhosted.org>
2019-03-20 02:30:09shoark7linkissue36377 messages
2019-03-20 02:30:09shoark7create