Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 17 Jul 2012 13:36:03 -0500 Date: Tue, 17 Jul 2012 19:36:00 +0100 From: Lipska the Kat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.python Subject: Re: Encapsulation, inheritance and polymorphism References: <3vnfd9-343.ln1@satorlaser.homedns.org> <-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d@bt.com> <5005A103.9050802@stoneleaf.us> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 39 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-SNiA2QQ0St47vdzsJKylURjIb+c3HfzP8UuMxYjIJLNeL7/66rnGPB2f0SFUZr+UrA8jdYHmMqhJYC/!doL12Ja8ETBevw5qDYHmK9u6VRoiqYo785tEVPvg+IFuNPbuKb6S24FUoNraV/+mmZ/0tv8Dapw= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2748 Xref: csiph.com comp.lang.python:25530 On 17/07/12 19:18, Mark Lawrence wrote: > 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? :-) > Not unless the compiler could read your mind! The syntax looks fine it's the semantics that are suspect. Wrong is a word that I try not to use as it tends to upset people, let's call them "differently right" ;-) BTW having more than one return statement in a block is a little thing I know but it drives me nuts ... another "Pythonic" thing I'll have to get used to I suppose. -- Lipska the Kat: Troll hunter, Sandbox destroyer and Farscape dreamer of Aeryn Sun.