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 Guillaume Dominici
Recipients Guillaume Dominici
Date 2018-09-21.08:37:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537519067.65.0.956365154283.issue34761@psf.upfronthosting.co.za>
In-reply-to
Content
The super proxy does not seem to forward call to .__str__() when the call occurs via str() function.
It may be an expected behavior, but it looks unexpected to me.

Minimal reproduction (tested on Python 3.6, but I believe may newer versions have similar behavior):

class Parent():
  def __str__(self):
    return "Parent"

class Child(Parent):
  def foo(self):
    s = super(Child, self)
    print(s.__str__())
    print(str(s))


c = Child()
c.foo()

# Output :
### Parent
### <super: <class 'Child'>, <Child object>>
History
Date User Action Args
2018-09-21 08:37:47Guillaume Dominicisetrecipients: + Guillaume Dominici
2018-09-21 08:37:47Guillaume Dominicisetmessageid: <1537519067.65.0.956365154283.issue34761@psf.upfronthosting.co.za>
2018-09-21 08:37:47Guillaume Dominicilinkissue34761 messages
2018-09-21 08:37:47Guillaume Dominicicreate