Message343491
Adding the __contains__() method to the count iterator would not solve the general problem with infinite iterators. For example with the following expressions:
-1 in filter(None, itertools.count())
-1 in map(float, itertools.count())
It is not worth to add a method just to handle a single case of misusing. You should not use "in" with infinite iterators. |
|
Date |
User |
Action |
Args |
2019-05-25 16:48:02 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, martin.panter, Dan Rose |
2019-05-25 16:48:02 | serhiy.storchaka | set | messageid: <1558802882.8.0.814699082128.issue37040@roundup.psfhosted.org> |
2019-05-25 16:48:02 | serhiy.storchaka | link | issue37040 messages |
2019-05-25 16:48:02 | serhiy.storchaka | create | |
|