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 ncoghlan
Recipients mdk, ncoghlan, rhettinger, seluj78, serhiy.storchaka, steven.daprano
Date 2018-11-18.10:53:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1542538398.76.0.788709270274.issue35200@psf.upfronthosting.co.za>
In-reply-to
Content
(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))".
History
Date User Action Args
2018-11-18 10:53:18ncoghlansetrecipients: + ncoghlan, rhettinger, steven.daprano, serhiy.storchaka, mdk, seluj78
2018-11-18 10:53:18ncoghlansetmessageid: <1542538398.76.0.788709270274.issue35200@psf.upfronthosting.co.za>
2018-11-18 10:53:18ncoghlanlinkissue35200 messages
2018-11-18 10:53:18ncoghlancreate