[issue13224] Change str(class) to return only the class name

2011-10-19 Thread Éric Araujo
New submission from Éric Araujo : Suggestion by Guido on #868845: Off-topic: I sometimes wish that the str() of a class would return the class name rather than its repr(); that way "print(str)" would print "str" instead of . (Use case: printing an exception and its message: I wish I could pr

[issue13224] Change str(class) to return only the class name

2011-10-19 Thread Éric Araujo
Changes by Éric Araujo : -- keywords: +patch Added file: http://bugs.python.org/file23468/change-class-__str__.diff ___ Python tracker ___ ___

[issue13224] Change str(class) to return only the class name

2011-10-19 Thread Éric Araujo
Éric Araujo added the comment: Suggestion by Guido on #868845: > I sometimes wish that the str() of a class would return the class name > rather than its repr(); that way "print(str)" would print "str" > instead of . (Use case: printing an exception and its > message: I wish I could print("%s:

[issue13224] Change str(class) to return only the class name

2011-10-19 Thread Éric Araujo
Changes by Éric Araujo : -- Removed message: http://bugs.python.org/msg145945 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue13224] Change str(class) to return only the class name

2011-10-19 Thread STINNER Victor
STINNER Victor added the comment: It looks like your change breaks backward compatibility (e.g. tests written using doctests). I don't know if it's a problem or not. -- nosy: +haypo ___ Python tracker ___

[issue13224] Change str(class) to return only the class name

2011-10-19 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue13224] Change str(class) to return only the class name

2011-10-21 Thread Éric Araujo
Éric Araujo added the comment: I would argue that the previous behavior of str(class) was undefined, or an implementation detail; as a new feature, my patch can break some code that relied on the previous behavior, but we may judge think it’s worth the cost. BTW, doctest is inherently fragile

[issue13224] Change str(class) to return only the class name

2011-10-22 Thread Éric Araujo
Éric Araujo added the comment: Here’s the python-ideas thread: http://mail.python.org/pipermail/python-ideas/2011-October/thread.html#12459 -- ___ Python tracker ___ __

[issue13224] Change str(class) to return only the class name

2011-10-27 Thread Guido van Rossum
Guido van Rossum added the comment: What's holding this up? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13224] Change str(class) to return only the class name

2011-10-28 Thread Éric Araujo
Éric Araujo added the comment: [Guido] > What's holding this up? - I haven’t updated the patch for function and module objects yet - I need to catch up with the python-ideas discussion - There is at least one strong argument against the idea (I’ll point it out on the ML) -- _

[issue13224] Change str(class) to return only the class name

2011-11-02 Thread Éric Araujo
Éric Araujo added the comment: I’ve updated my patch to handle modules and functions too, but there is a decision to make. The functions of built-in modules are implemented by methodobject.c, not functionobject.c (that’s for Python functions), so if we want str(sys.exc_info) to be equal to '

[issue13224] Change str(class) to return only the class name

2011-11-02 Thread Guido van Rossum
Guido van Rossum added the comment: On Wed, Nov 2, 2011 at 9:31 AM, Éric Araujo wrote: > > Éric Araujo added the comment: > > I’ve updated my patch to handle modules and functions too, but there is a > decision to make.  The functions of built-in modules are implemented by > methodobject.c,

[issue13224] Change str(class) to return only the class name

2011-11-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Please also see the proposed PEP 3155 - http://mail.python.org/pipermail/python-ideas/2011-October/012609.html -- nosy: +pitrou ___ Python tracker ___

[issue13224] Change str(class) to return only the class name

2011-11-03 Thread Éric Araujo
Éric Araujo added the comment: > Please also see the proposed PEP 3155 I’ve seen it and like it. I assume you’re telling that we should consider str(cls/mod/func) to return the qname instead of the name? I think it could be good. My patch can wait for your PEP, or go in first and be updated

[issue13224] Change str(class) to return only the class name

2011-11-07 Thread Éric Araujo
Éric Araujo added the comment: I misreported: dict.update is actually okay, but collections.Counter.update (a Python method) is a not an unbound method but a function (py3k-style). -- ___ Python tracker _