On Sat, Apr 21, 2012 at 6:17 AM, Rotwang <sg...@hotmail.co.uk> wrote:
> In general there's no reason why
>
>>>> a.method(arguments)
>>>> print a
>
> will print the same thing as
>
>>>> print a.method(arguments)
>
> since a method doesn't assign the value it returns to the instance on which
> it is called; what it does to the instance and what it returns are two
> completely different things.

It wouldn't ever assign its return value to the instance, but it might
return self, which allows method chaining. Can be very handy, though I
don't know off-hand how common it is in Python.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to