On 12/27/2015 06:16 PM, Guido van Rossum wrote:
On Sat, Dec 26, 2015 at 10:19 PM, Nick Coghlan <ncoghlan@gmail.com <mailto:ncoghlan@gmail.com>> wrote:
On 27 December 2015 at 07:05, Andrew Barnert via Python-ideas <python-ideas@python.org <mailto:python-ideas@python.org>> wrote: > At any rate, I think what people are actually worried about here is not the theoretical chance that such a regression might have happened 5 years ago, but the more practical fact that 3.x might be misleading to human beings in cases where 2.x wasn't. For example, if you mostly do 3.x NumPy stuff, you're used to passing ellipses around, and maybe even storing them in index arrays, but you rarely if ever see a circular list. So, when you see, say, `[[1], [2], [...]]` on the REPL, you may misinterpret it as meaning something different from what it does.
Right, this is the reason I think it's reasonable to suggesting changing the recursive repr - the current form is one that *humans* that have only learned Python 3 are likely to misinterpret, since the fact that "repr(...)"produces "Ellipsis" rather than "..." is itself a quirk originating in the fact that "..." is restricted to subscripts in Python 2.
I don't think it's a major problem (as recursive container representations aren't something that comes up every day), but switching to "<...>" does have the advantage of allowing for a consistent recursive reference representation across all container types, regardless of whether they have native syntax or not.
I really feel you all are overworrying and overthinking this. A downside to me is that <...> isn't clear about what the type of the object is. The use case here is not sophisticated users, it's beginners who have accidentally managed to create a recursive list or dict. They have most likely not even encountered Ellipsis objects yet. There's nothing clearer than the current notation to help them see that they've done something unusual.
I'm not sure. As a newcomer, I would see the "..." ellipsis as "something has been left out" (possibly because of printout length etc., exactly as it is used in numpy, BTW), not "you made a recursive structure". Explicit (and still un-evalable) would be e.g. "<recursive>" Georg