Message330042
(Retitled the issue to better reflect the underlying feature request)
As Steven describes, there are enough problems with changing range.__repr__ that if that's the proposal, then the only possible answer is "No", and closing the issue.
However, changing range.__str__ (and hence print, f-strings, logging, and more) offers many of the same benefits, without most of the downsides (repr will still roundtrip through eval, doctests won't break, etc).
The only potential benefit that gets lost is the fact that entering "range(10)" at the REPL will still print "range(0, 10)", such that you need to do "print(range(10))" to get the version that shows the endpoint values. For longer ranges, "print(range(100))" will still end up being a lot more user friendly than "print(list(100))". |
|
Date |
User |
Action |
Args |
2018-11-18 10:53:18 | ncoghlan | set | recipients:
+ ncoghlan, rhettinger, steven.daprano, serhiy.storchaka, mdk, seluj78 |
2018-11-18 10:53:18 | ncoghlan | set | messageid: <1542538398.76.0.788709270274.issue35200@psf.upfronthosting.co.za> |
2018-11-18 10:53:18 | ncoghlan | link | issue35200 messages |
2018-11-18 10:53:18 | ncoghlan | create | |
|