Issue1612713

classification
Title: Bug [ 1604264 ] str(o) on str subclass o uses o.__repr__() n
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, h_eriksson
Priority: normal Keywords: patch

Created on 2006-12-10.18:43:07 by h_eriksson, last changed 2007-01-20.17:52:27 by cgroves.

Files
File name Uploaded Description Edit Remove
Bug1604264.patch h_eriksson, 2006-12-10.18:43:07
Messages
msg2569 (view) Author: Henrik Eriksson (h_eriksson) Date: 2006-12-10.18:43:07
Bugfix for [ 1604264 ] str(o) on str subclass o uses o.__repr__() not o.__str__()
msg2570 (view) Author: Charlie Groves (cgroves) Date: 2007-01-02.01:30:03
I don't understand why for_type should be PyStringDerived as the patch says.  I thought for_type on PyNewWrapper indicated the type the new worked for?  

It seems to me that the problem is in PyString.returnString where if S is an instance of PyString, it's returned regardless of if it happens to be a subclass of str that has an implementation of __str__  
msg2571 (view) Author: Henrik Eriksson (h_eriksson) Date: 2007-01-02.08:45:37
You're right. I was a bit too eager to fix this as easily as possible without having a correct grasp of how it worked. I will look into "fixing" it in returnString instead. Sorry!
msg2572 (view) Author: Charlie Groves (cgroves) Date: 2007-01-20.17:52:27
I did what I described in my comment in r3053.  Hope I didn't step on your toes!
History
Date User Action Args
2006-12-10 18:43:07h_erikssoncreate