[pypy-dev] special methods

Armin Rigo arigo at tunes.org
Thu Mar 29 19:39:17 CEST 2007


Hi Michael,

On Thu, Mar 29, 2007 at 06:26:37PM +0100, Michael Hudson wrote:
> Well, if you write str([x]) then x.__str__() will certainly not be called :-)

Ah right.  Then  '%s' % (x,) .

So far the rtyper has no notion of the "repr" of an object being
something else than its "str", so str([x]) is really the same as '[' +
str(x) + ']'.  All this stuff would need clean-ups before we go more in
the direction of fully supporting custom __str__() methods...


A bientot,

Armin.



More information about the Pypy-dev mailing list