New submission from Edd Barrett <[email protected]>:

Hi,

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 <[email protected]>
<https://bugs.pypy.org/issue1605>
________________________________________
_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to