Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.038 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'attribute': 0.07; 'preferable': 0.09; 'subject:Function': 0.09; 'creates': 0.14; 'thread': 0.14; 'exception': 0.16; 'pointed': 0.19; 'earlier': 0.24; '>': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '(which': 0.31; 'yes.': 0.31; 'problem': 0.35; 'subject: (': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'returning': 0.36; 'problems': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'making': 0.63; 'why?': 0.91; 'convinced': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DsnBvj4UM61iJ/imH3f1TXQjz8KqlV0/0GFzEXdcUjo=; b=leUi4SD4tLcXQsJvcEvaCu1TOtLH0q/dqINf0RUWns40bYLuGTsd0AmLIrNAHNdcZC Qeon9IpaMtXmffzvcWoEZ/SXtWS+flvSnIPu00kV9EqxBv4r5ojshC8HnmwdBWG7MVkb owDm7U3s3DmCwLF1mMd7kliVaeD6SyyZR2zgbhoR//0D4PnL6ez4+CNX2P3p9QNQxhcX lcMD/amgKG9Dyu7JV38RZrkCffYKNgzbAlETpVkziWW4S+jdEnAPYc5yfIObaEw1gsxN tt2fT0xnSnzQWR0Y3aKyT4MMj6kgUvVKXgSIAeDyBUroqQaqKvARKNYzXLNTyy1wFE5n ecUw== MIME-Version: 1.0 X-Received: by 10.236.13.46 with SMTP id a34mr14494804yha.28.1402323875285; Mon, 09 Jun 2014 07:24:35 -0700 (PDT) In-Reply-To: <53952fa9$0$29988$c3e8da3$5496439d@news.astraweb.com> References: <8b96ae27-20fa-4df9-807e-c806fed983c0@googlegroups.com> <1dd863ba-09e5-439b-8669-db65f3e999eb@googlegroups.com> <927afb61-be0e-43a1-8aab-107e77a013fc@googlegroups.com> <53952fa9$0$29988$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 9 Jun 2014 08:24:35 -0600 Subject: Re: Uniform Function Call Syntax (UFCS) From: Ian Kelly To: Python Content-Type: multipart/alternative; boundary=001a11c3dc3a724f0404fb67f873 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402324360 news.xs4all.nl 2878 [2001:888:2000:d::a6]:34617 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73032 --001a11c3dc3a724f0404fb67f873 Content-Type: text/plain; charset=UTF-8 On Jun 8, 2014 9:56 PM, "Steven D'Aprano" > > which means that hasattr (which is defined by > > attempting to get the attribute and seeing if an exception is thrown) > > has to return True. > > Yes. And this is a problem why? Earlier in this thread I pointed out that returning True creates problems for duck typing. But I'm now convinced that's preferable to making getattr and hasattr inconsistent. --001a11c3dc3a724f0404fb67f873 Content-Type: text/html; charset=UTF-8


On Jun 8, 2014 9:56 PM, "Steven D'Aprano"
> > which means that hasattr (which is defined by
> > attempting to get the attribute and seeing if an exception is thrown)
> > has to return True.
>
> Yes. And this is a problem why?

Earlier in this thread I pointed out that returning True creates problems for duck typing. But I'm now convinced that's preferable to making getattr and hasattr inconsistent.

--001a11c3dc3a724f0404fb67f873--