Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22182

Re: Puzzled by FiPy's use of "=="

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 <python-python-list@m.gmane.org>
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 <robert.kern@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.996.1332764185.3037.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Puzzled by FiPy's use of "==" André Roberge <andre.roberge@gmail.com> - 2012-03-26 04:47 -0700
  Re: Puzzled by FiPy's use of "==" Robert Kern <robert.kern@gmail.com> - 2012-03-26 13:16 +0100
    Re: Puzzled by FiPy's use of "==" André Roberge <andre.roberge@gmail.com> - 2012-03-26 05:21 -0700
    Re: Puzzled by FiPy's use of "==" André Roberge <andre.roberge@gmail.com> - 2012-03-26 05:21 -0700

csiph-web