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


Groups > comp.lang.python > #44312

Re: epiphany

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'abuse': 0.07; 'method.': 0.07; 'appropriate.': 0.09; 'falls': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'implemented.': 0.09; 'means,': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:184.172': 0.09; 'received:gator410.hostgator.com': 0.09; '~ethan~': 0.09; 'python': 0.11; 'assume': 0.14; 'random': 0.14; 'means.': 0.16; "object's": 0.16; 'rule.': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'raise': 0.29; "d'aprano": 0.31; 'steven': 0.31; 'supposed': 0.32; 'implemented': 0.33; 'something': 0.35; 'case,': 0.35; 'objects': 0.35; 'consistent': 0.36; 'false': 0.36; 'yours,': 0.36; 'method': 0.36; 'application': 0.37; 'so,': 0.37; 'implement': 0.38; 'sometimes': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'expect': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'even': 0.60; 'signal': 0.60; 'received:173': 0.61; "you're": 0.61; 'back': 0.62; 'skip:n 10': 0.64; 'different': 0.65; 'default': 0.69; 'expectations': 0.74; 'special': 0.74; 'does?': 0.84; 'hardly': 0.84
Date Wed, 24 Apr 2013 19:25:37 -0700
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: epiphany
References <roy-23D9FA.19503324042013@news.panix.com> <5178884b$0$29977$c3e8da3$5496439d@news.astraweb.com>
In-Reply-To <5178884b$0$29977$c3e8da3$5496439d@news.astraweb.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - gator410.hostgator.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - stoneleaf.us
X-BWhitelist no
X-Source
X-Source-Args
X-Source-Dir
X-Source-Sender ([173.12.184.235]) [173.12.184.235]:40510
X-Source-Auth ethan+stoneleaf.us
X-Email-Count 1
X-Source-Cap dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ==
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.1045.1366857991.3114.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1366857991 news.xs4all.nl 15867 [2001:888:2000:d::a6]:51927
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44312

Show key headers only | View raw


On 04/24/2013 06:35 PM, Steven D'Aprano wrote:
> Objects are supposed to return NotImplemented from special dunder methods
> like __add__, __lt__, etc. to say "I don't know how to implement this
> method for the given argument". Python will then try calling the other
> object's special method. If both objects return NotImplemented, Python
> falls back on whatever default behaviour is appropriate.
>
> So, knowing nothing of your application, I fear that this is an abuse of
> NotImplemented's semantics. If a rule returns NotImplemented, I would
> expect your application to fall back on a different rule. If that's not
> the case, you're using it in a non-standard way that will cause confusion
> for those with expectations of what NotImplemented means.

Why would you assume some random application is going to deal with NotImplemented the same way the python interpreter 
does?  And even the interpreter isn't consistent -- sometimes it will return false (__eq__) and sometimes it will raise 
an Exception (__add__).

I hardly think it an abuse of NotImplemented to signal something is not implemented when NotImplemented means, um, not 
implemented.

possibly-not-implemented-ly yours,

--
~Ethan~

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


Thread

epiphany Roy Smith <roy@panix.com> - 2013-04-24 19:50 -0400
  Re: epiphany Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-25 01:35 +0000
    Re: epiphany Roy Smith <roy@panix.com> - 2013-04-24 21:41 -0400
      Re: epiphany Chris Angelico <rosuav@gmail.com> - 2013-04-25 12:20 +1000
        Re: epiphany Roy Smith <roy@panix.com> - 2013-04-24 22:33 -0400
      Re: epiphany Ethan Furman <ethan@stoneleaf.us> - 2013-04-24 19:28 -0700
    Re: epiphany Ethan Furman <ethan@stoneleaf.us> - 2013-04-24 19:25 -0700
      Re: epiphany Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-25 04:32 +0000
        Re: epiphany Roy Smith <roy@panix.com> - 2013-04-25 08:36 -0400
          Re: epiphany Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-25 12:52 +0000
            Re: epiphany Roy Smith <roy@panix.com> - 2013-04-25 09:15 -0400
  Re: epiphany 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-28 14:14 -0700

csiph-web