Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.04; 'compiler': 0.05; 'debug': 0.05; 'type,': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; '~ethan~': 0.09; 'def': 0.10; "wouldn't": 0.11; ':-)': 0.13; 'b):': 0.16; 'declaration': 0.16; 'inputs': 0.16; 'message-id:@dough.gmane.org': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'unittests': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'meant': 0.21; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'checking': 0.27; 'restrict': 0.27; 'header:X-Complaints-To:1': 0.28; 'declared': 0.29; "i'm": 0.29; "skip:' 10": 0.30; 'usually': 0.30; 'function': 0.30; 'code': 0.31; '(and': 0.32; 'from:addr:yahoo.co.uk': 0.32; 'surely': 0.33; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'quite': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'easier': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'subject:, ': 0.61; 'strange': 0.62; 'limited.': 0.64; 'making': 0.64; "'if": 0.84; 'furman': 0.84; 'received:89': 0.86; 'ethan': 0.91; 'kat': 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: Tue, 17 Jul 2012 19:18:21 +0100 References: <3vnfd9-343.ln1@satorlaser.homedns.org> <-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d@bt.com> <5005A103.9050802@stoneleaf.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-89-243-194-149.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: <5005A103.9050802@stoneleaf.us> X-Antivirus: avast! (VPS 120717-0, 17/07/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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342549103 news.xs4all.nl 6909 [2001:888:2000:d::a6]:58952 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25528 On 17/07/2012 18:29, Ethan Furman wrote: > Terry Reedy wrote: >> On 7/17/2012 10:23 AM, Lipska the Kat wrote: >> >>> Well 'type-bondage' is a strange way of thinking about compile time type >>> checking and making code easier to read (and therefor debug >> >> 'type-bondage' is the requirement to restrict function inputs and >> output to one declared type, where the type declaration mechanisms are >> usually quite limited. >> >> >>> def max(a, b): >> if a <= b: return a >> return b > > > Surely you meant 'if a >= b: . . .' > > No worries, I'm sure your unittests would have caught it. ;) > > ~Ethan~ Wouldn't the compiler have caught it before the unittests? :-) -- Cheers. Mark Lawrence.