Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.046 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'pointers': 0.09; 'andr\xe9': 0.16; 'enigma': 0.16; 'equations': 0.16; 'kern': 0.16; 'received:80.91': 0.16; 'received:80.91.229': 0.16; 'received:gmane.org': 0.16; 'received:list': 0.16; 'redefinition': 0.16; 'underlying': 0.16; 'robert': 0.18; 'wrote:': 0.21; 'root': 0.22; 'header:In-Reply-To:1': 0.22; 'header:User-Agent:1': 0.23; 'appreciated.': 0.24; 'somewhere': 0.27; 'pm,': 0.28; 'url:terms': 0.29; 'class': 0.29; 'done.': 0.30; 'source': 0.31; 'header:X -Complaints-To:1': 0.36; 'but': 0.36; 'url:org': 0.36; 'received:org': 0.38; 'base': 0.39; "can't": 0.39; 'to:addr :python-list': 0.39; 'how': 0.40; 'to:addr:python.org': 0.40; 'files,': 0.63; 'our': 0.64; 'world': 0.65; 'believe': 0.67; '12:47': 0.84; 'solved': 0.84; 'terrible': 0.84; 'eco': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robert Kern Subject: Re: Puzzled by FiPy's use of "==" Date: Mon, 26 Mar 2012 13:16:07 +0100 References: <24963904.2261.1332762433787.JavaMail.geo-discussion-forums@vbbfw10> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 94.197.127.115.threembb.co.uk User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120313 Thunderbird/11.0 In-Reply-To: <24963904.2261.1332762433787.JavaMail.geo-discussion-forums@vbbfw10> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332764185 news.xs4all.nl 6898 [2001:888:2000:d::a6]:49520 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22182 On 3/26/12 12:47 PM, André Roberge wrote: > In FiPy (a finite volume PDE solver), equations are "magically" set up as > > eqX = TransientTerm() == ExplicitDiffusionTerm(coeff=D) > > and solved via > > eqX.solve(...) > > How can eqX be anything than True or False?... This must be via a redefinition of "==" but I can't see how that is done. I did look at many of the source files, thinking that it must be via a redefinition of "__eq__" somewhere but with no luck. Any pointers would be appreciated. It's in the root base class Term: http://matforge.org/fipy/browser/trunk/fipy/terms/term.py#L374 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco