Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'attribute': 0.05; 'case.': 0.05; 'none,': 0.05; '-0500': 0.07; 'parameter': 0.07; '(it': 0.09; 'descriptor': 0.09; 'exception,': 0.09; 'itself,': 0.09; 'raised.': 0.09; 'satisfy': 0.09; 'cases': 0.15; 'object).': 0.16; 'set,': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'translate': 0.20; 'to:name:python-list@python.org': 0.20; 'skip:- 40': 0.21; 'thanks.': 0.21; 'do.': 0.21; 'minor': 0.22; 'to:2**1': 0.23; 'properties': 0.24; 'raise': 0.24; 'thus': 0.24; 'header:In- Reply-To:1': 0.25; 'am,': 0.27; 'mind.': 0.27; "doesn't": 0.28; 'unlikely': 0.29; 'date:': 0.29; 'url:mailman': 0.29; 'objects': 0.29; 'class': 0.29; 'checks': 0.30; 'fri,': 0.30; 'function': 0.30; 'sense': 0.31; 'url:python': 0.32; 'could': 0.32; 'url:listinfo': 0.32; 'from:addr:live.com': 0.33; 'true.': 0.33; 'to:addr:python-list': 0.33; 'nov': 0.35; 'add': 0.36; 'subject:': 0.36; 'but': 0.36; 'url:org': 0.36; 'email addr:python.org': 0.36; 'useful': 0.36; 'being': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'url:mail': 0.40; 'email name:python-list': 0.62; 'potentially': 0.66; 'realized': 0.71; 'special': 0.73; '99.9%': 0.84; 'actually,': 0.84; 'forced': 0.84; 'outcome:': 0.84; 'to:addr:msn.com': 0.93; 'charset:windows-1251': 0.97 X-Originating-IP: [194.44.213.194] From: Andriy Kornatskyy To: , "python-list@python.org" Subject: RE: Lazy Attribute Date: Fri, 16 Nov 2012 13:31:58 +0300 Importance: Normal In-Reply-To: <%jops.44$TT7.13@newsfe04.iad> References: , , , , , <%jops.44$TT7.13@newsfe04.iad> Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 16 Nov 2012 10:31:59.0539 (UTC) FILETIME=[9BF9F830:01CDC3E5] 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353061987 news.xs4all.nl 6927 [2001:888:2000:d::a6]:47288 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33427 This is very minor use case. Unlikely useful to add any checks for None=2C = or translate one exception to the other... with pretty much the same outcom= e: it makes sense in objects only. Thanks. Andriy ---------------------------------------- > From: rouslank@msn.com > Subject: Re: Lazy Attribute > Date: Fri=2C 16 Nov 2012 05:12:11 -0500 > To: python-list@python.org > > On 11/16/2012 04:32 AM=2C Rouslan Korneychuk wrote: > > On 11/16/2012 02:49 AM=2C Andriy Kornatskyy wrote: > >>> If accessing the descriptor on the class object has no special > >>> meaning=2C then the custom is to return the descriptor object itself= =2C as > >>> properties do. > >> > >> If I would satisfy this=2C I will be forced to check for None 99.9% of > >> the use cases (it is not None=2C being applied to an object). Thus it > >> behaves as designed. > > > > That's not true. You can use a try-except block to return the descripto= r > > object when an AttributeError is raised. > > Actually=2C never mind. I just realized the function has to be called > before the attribute can be set=2C which can not-only raise any exception= =2C > but could potentially have undesired side-effects given a parameter it > doesn't expect. > -- > http://mail.python.org/mailman/listinfo/python-list =