Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'filing': 0.07; 'appropriate.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; "wouldn't": 0.11; 'hire': 0.15; 'value.': 0.15; 'egg': 0.16; 'horst': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'utilties': 0.16; 'wording': 0.16; 'wrote:': 0.17; 'variables': 0.17; '>>>': 0.18; 'example': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'values': 0.26; 'am,': 0.27; 'continuing': 0.27; 'forgot': 0.27; 'header:X-Complaints-To:1': 0.28; "d'aprano": 0.29; 'ray': 0.29; 'steven': 0.29; 'van': 0.29; 'function': 0.30; 'sense': 0.31; 'code': 0.31; 'from:addr:yahoo.co.uk': 0.32; 'done,': 0.33; 'surely': 0.33; 'to:addr:python-list': 0.33; 'needed': 0.35; 'robert': 0.35; 'received:org': 0.36; 'but': 0.36; 'enough': 0.36; 'keeps': 0.37; 'why': 0.37; 'quite': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'apply': 0.39; 'header:Received:5': 0.40; 'your': 0.60; "you've": 0.61; 'subject:, ': 0.61; 'first': 0.61; 'fire': 0.62; 'unnecessary': 0.65; 'want,': 0.65; 'applying': 0.69; 'article': 0.78; 'gas': 0.81; 'hour,': 0.84; 'still.': 0.84; 'albert': 0.91; 'heat': 0.91; 'subject:skip:E 10': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Encapsulation, inheritance and polymorphism Date: Sun, 19 Aug 2012 09:55:18 +0100 References: <5006b48a$0$29978$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-146-9-229.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: X-Antivirus: avast! (VPS 120819-0, 19/08/2012), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345366471 news.xs4all.nl 6906 [2001:888:2000:d::a6]:42296 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27364 On 19/08/2012 06:21, Robert Miles wrote: > On 7/23/2012 11:18 AM, Albert van der Horst wrote: >> In article <5006b48a$0$29978$c3e8da3$5496439d@news.astraweb.com>, >> Steven D'Aprano wrote: >> >> Even with a break, why bother continuing through the body of the >>> function >>> when you already have the result? When your calculation is done, it's >>> done, just return for goodness sake. You wouldn't write a search that >>> keeps going after you've found the value that you want, out of some >>> misplaced sense that you have to look at every value. Why write code >>> with >>> unnecessary guard values and temporary variables out of a misplaced >>> sense >>> that functions must only have one exit? >> >> Example from recipee's: >> >> Stirr until the egg white is stiff. >> >> Alternative: >> Stirr egg white for half an hour, >> but if the egg white is stiff keep your spoon still. >> >> (Cooking is not my field of expertise, so the wording may >> not be quite appropriate. ) >> >>> -- >>> Steven >> >> Groetjes Albert > > Note that you forgot applying enough heat to do the cooking. > > Surely the first check is your filing system to make sure that you've paid the utilties bills so you've got gas and or electricity to apply the heat. Either that or you hire Ray Mears to produce the spark needed to light the fire :) -- Cheers. Mark Lawrence.