Message295327
The current behaviour of islice() seems inconsistent with the rest of Python. All other functions taking start, stop and step arguments like slice(), range() and itertools.count() do accept integer-like objects. The code given as "roughly equivalent" in the documentation of islice() accepts integer-like objects, and so does regular list slicing. In fact, the __index__() method was introduced in PEP 357 specifically for slicing. In Python 2, islice() supported it as well. I think the expectation that islice() in Python 3 also supports it is entirely reasonable, and I can't see any strong arguments for breaking that assumption. |
|
Date |
User |
Action |
Args |
2017-06-07 10:00:49 | smarnach | set | recipients:
+ smarnach, rhettinger, mark.dickinson, serhiy.storchaka, MSeifert, Will Roberts |
2017-06-07 10:00:49 | smarnach | set | messageid: <1496829649.48.0.20171348112.issue30537@psf.upfronthosting.co.za> |
2017-06-07 10:00:49 | smarnach | link | issue30537 messages |
2017-06-07 10:00:49 | smarnach | create | |
|