Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1.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.044 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'attribute': 0.07; 'explicit': 0.07; 'method,': 0.09; '"get",': 0.16; 'fail,': 0.16; 'subject:Classes': 0.16; 'wrote:': 0.18; '31,': 0.24; 'possibly': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'properties': 0.29; 'needed.': 0.30; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'fast.': 0.31; 'steven': 0.31; 'probably': 0.32; 'supposed': 0.32; 'quite': 0.32; 'fri,': 0.33; 'agree': 0.35; 'except': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'should': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'bad': 0.39; 'to:addr:python.org': 0.39; 'times': 0.62; 'complex,': 0.84; 'lightweight': 0.84; 'choice.': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=0Pq2Z9sGHiv0zq5+ETx/15KoJzxWQ4qVaQ09M/yMNo8=; b=HyDy0B1j0XpvI4xDxwWajcmDgRPBSS8AwuEe7anxLu7y98L/NHbRBVHVHwGLQIcHVc ee5twTrYWCmBgV+JegiJv6vtXDdjNuqq2vZHyAag125gx2gQ/NhWdHgacWpJK2/Fvpc0 +McjmtnX1pGvpbTXyzzpfImLN36fDKBx2s1k1pTcaEHULbh2vZOygowxcEn2upIqBL9C zLqUyt7BsDD3ypB2IwqxuZ+BVVrUASetSbn1MWgIVQ961xsB/tSGhsTDiwLbksKfVDOQ OL2ikpkSAb0sp1HgtGYwVmtKz21Ht70i30z6AJNCkyjGbBbF994s0C4T0tgLTyCvMMWD lXoA== X-Received: by 10.66.254.164 with SMTP id aj4mr33344pad.116.1414822413689; Fri, 31 Oct 2014 23:13:33 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <54543231$0$13000$c3e8da3$5496439d@news.astraweb.com> References: <51755at03r0bidjqh3qf0hhpvjr8756ill@4ax.com> <545350c3$0$23449$426a74cc@news.free.fr> <54543231$0$13000$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Sat, 1 Nov 2014 00:12:53 -0600 Subject: Re: Classes To: Python Content-Type: text/plain; charset=UTF-8 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414822424 news.xs4all.nl 2955 [2001:888:2000:d::a6]:38229 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80073 On Fri, Oct 31, 2014 at 7:06 PM, Steven D'Aprano wrote: > And there are times when using getters and setters is the right choice. > Properties should only be used for quite lightweight calculations, because > attribute access is supposed to be fast. If your calculation is complex, > time-consuming or might fail, using a property is a bad idea and you should > use an explicit getter method, possibly with a setter if needed. I agree except that in this scenario you should probably use a verb other than "get", since getters should also be fast.