Message329671
I agree with Steven and Raymond on this one: changing __repr__ on ranges in a way that breaks round-tripping through eval would be problematic, especially as I'd expect that to be an issue in doctests as well.
However, I also like the idea of having easier access to a more list-like representation that shows the actual range endpoints, not just the inputs used to calculate them, and like Steven, I'm more comfortable with changing __str__ than I am with changing __repr__.
That would give:
>>> range(10)
range(0, 10)
>>> print(range(10))
<range object: [0, 1, ..., 8, 9]> |
|
Date |
User |
Action |
Args |
2018-11-11 08:55:32 | ncoghlan | set | recipients:
+ ncoghlan, rhettinger, steven.daprano, serhiy.storchaka, mdk, seluj78 |
2018-11-11 08:55:32 | ncoghlan | set | messageid: <1541926532.52.0.788709270274.issue35200@psf.upfronthosting.co.za> |
2018-11-11 08:55:32 | ncoghlan | link | issue35200 messages |
2018-11-11 08:55:32 | ncoghlan | create | |
|