Path: csiph.com!usenet.pasdenom.info!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Bitten by my C/Java experience Date: Wed, 06 May 2015 23:15:42 +1200 Lines: 16 Message-ID: References: <87r3qwid3u.fsf@Equus.decebal.nl> <55487d30$0$2917$c3e8da3$76491128@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net DnhgV1e9Xq0qFukRrOf/OgU9xR7yjHHIQ3qlF+aOLkWMjz5LL+ Cancel-Lock: sha1:7WGlae6XuKwNJW0PGdFOzAGuV9k= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <55487d30$0$2917$c3e8da3$76491128@news.astraweb.com> Xref: csiph.com comp.lang.python:90045 Steven D'Aprano wrote: > The first one just does a name lookup and then throws the result away. The > second one looks up names a and b, then adds them together, throwing away > the result. Actually, it's worse than that. :-) It's possible for a to have an __add__ method with a side effect, although that would be evil. It's also possible for merely looking up a name to have a side effect, if it's done in the right context -- but that would be even more evil. -- Greg