Strange __str__ behavior

Chris Liechti cliechti at gmx.net
Fri Nov 9 15:39:22 EST 2001


[posted and mailed]

"Emile van Sebille" <emile at fenx.com> wrote in
news:9shev1$136lad$1 at ID-11957.news.dfncis.de: 
> I don't get the same thing on win2k

yes you get the same...

> F:\Python22>python
> ActivePython 2.2 Alpha 2 build 1 (ActiveState)
> Python 2.2a2+ (#22, Sep  5 2001, 14:10:41) [MSC 32 bit (Intel)] on
> win32 
>>>> class Test:
> ...     def __str__(self):
> ...             print "in __str__"
> ...             return "str(self)"
> ...
>>>> test = Test()
>>>> print test
>  in __str__

 ^ its this space thats the problem

> str(self)
>>>>

--
Chris <cliechti at gmx.net>




More information about the Python-list mailing list