Patches item #1673355, was opened at 2007-03-04 00:40
Message generated for change (Comment added) made by johnreese
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1673355&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: John Reese (johnreese)
Assigned to: Nobody/Anonymous (nobody)
Summary: change repr(...) from 'Ellipsis' to '...'

Initial Comment:
Given that in Python 3000 you can now use ... as an expression, it seemed like 
its repr might as well be ... too.  The thread quoted in pep 3100 as the reason 
for the decision suggested using '(int, ...)' as a type annotation; in such 
expressions, having ... print as ... would be more readable.

Note that this would break any doctests including ellipses; none of the 
Lib/test tests do, and the non-doctests don't care about the repr and still 
pass.  Since prior to Python 3000 ... could only be used in slices, it's 
unlikely this will break much.

I have now written about 100 times more characters than are changed by the 
patch.

----------------------------------------------------------------------

>Comment By: John Reese (johnreese)
Date: 2007-03-04 17:14

Message:
Logged In: YES 
user_id=1734721
Originator: YES

(Continuing to talk to myself)

It's funny, I mentioned doctest already, thinking just that 'Ellipsis'
would now print as '...' and the difference would cause incompatibilities;
i.e. the same problem you get any time a __repr__ changes.  But there's a
worse problem, which is that '...' looks almost exactly like sys.PS2, so a
doctest like this will mistake the output for a continuation line and
fail:

"""
>>> Ellipsis
...
"""
**********************************************************************
File "./doctesterr.py", line 6, in __main__
Failed example:
    Ellipsis
Expected nothing
Got:
    ...
**********************************************************************


In light of which grossness this trivial patch is probably not worth it.

----------------------------------------------------------------------

Comment By: John Reese (johnreese)
Date: 2007-03-04 00:43

Message:
Logged In: YES 
user_id=1734721
Originator: YES

> The thread quoted
is
http://mail.python.org/pipermail/python-3000/2006-April/000951.html
just so you don't have to hunt around.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1673355&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches

Reply via email to