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-11.08:55:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1541926532.52.0.788709270274.issue35200@psf.upfronthosting.co.za>
In-reply-to
Content
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]>
History
Date User Action Args
2018-11-11 08:55:32ncoghlansetrecipients: + ncoghlan, rhettinger, steven.daprano, serhiy.storchaka, mdk, seluj78
2018-11-11 08:55:32ncoghlansetmessageid: <1541926532.52.0.788709270274.issue35200@psf.upfronthosting.co.za>
2018-11-11 08:55:32ncoghlanlinkissue35200 messages
2018-11-11 08:55:32ncoghlancreate