[pypy-issue] [issue1605] __str__ is not RPython?

Edd Barrett tracker at bugs.pypy.org
Fri Sep 13 14:23:00 CEST 2013

New submission from Edd Barrett <vext01 at gmail.com>:


I spent some time today working on a custom interpreter written in RPython. I 
was trying to figure out why my get_printable_location() was not calling __str__ 
upon instances. It seems that if you try to str() an instance in RPython, str() 
is ignored entirely and instead the generic str() is called.

E.g. 'def get_printable_location(x): return str(x)' will not call __str__ upon 
x, but instead will print the generic string representation.

If calling str() (and others?) is not RPython then perhaps an error should be 
thrown. If calling str() is RPython, then we have a bug?

Can someone clarify? Thanks.

messages: 6161
nosy: pypy-issue, vext01
priority: bug
status: unread
title: __str__ is not RPython?

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list