Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'output': 0.04; 'received:209.85.160.174': 0.07; 'type,': 0.07; 'other,': 0.09; 'terry': 0.09; 'cc:addr:python-list': 0.10; 'language': 0.14; 'declaration': 0.16; 'definition.': 0.16; 'guess.': 0.16; 'inputs': 0.16; 'language?': 0.16; 'reedy': 0.16; 'wrote:': 0.17; 'otherwise,': 0.20; 'sort': 0.21; 'java': 0.21; 'lets': 0.22; 'universal': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'restrict': 0.27; 'message-id:@mail.gmail.com': 0.27; 'interface': 0.27; 'declared': 0.29; 'obj': 0.29; 'objects': 0.29; "skip:' 10": 0.30; 'usually': 0.30; 'function': 0.30; 'received:google.com': 0.34; 'expected': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; '(i.e.': 0.36; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'supports': 0.38; 'instead': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'easy': 0.60; 'subject:, ': 0.61; '(that': 0.62; 'different': 0.63; 'limited.': 0.64; 'jul': 0.65; 'comparable': 0.84; 'interesting,': 0.84; 'max,': 0.84; 'subject:skip:E 10': 0.95 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 :cc:content-type; bh=O/7wFiSjRAn1t4ma5NILEQoORmem5+W3CNY7kUnJYJw=; b=g2by5drmk6ghx9mC/yhBugm96sxUb/r0rqo2mOSRTLj3SepVlu5TT105X1Fn+gZ3oG oiebsUXUaTJIIhHz9cMWfeVMZzxpi5Y/S/dF5oblrPLszKHxVict2lbWOPsddeTwWvdc qbT51KPqsTa/+PfWYlaF6Wv18ZDw7uX0mgGcknQ8I7KSyjRW71lDS2B0jgwGqAoL/v5U d5oVJuiLAxvMfQOQYuYpLrVml/1seY2GJhg3KJXZBHBbHedsGkx3fDxTJhDv3dQ2ZZv/ z8MGdb82x9diPJBJEvxxNPkjnzsopgoODF4ljyEViksUuToHvWzeJBH3SFhkFOpAARS1 7C4A== MIME-Version: 1.0 In-Reply-To: References: <3vnfd9-343.ln1@satorlaser.homedns.org> <-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d@bt.com> From: Devin Jeanpierre Date: Tue, 17 Jul 2012 15:05:26 -0400 Subject: Re: Encapsulation, inheritance and polymorphism To: Terry Reedy Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342551970 news.xs4all.nl 6931 [2001:888:2000:d::a6]:52246 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25533 On Tue, Jul 17, 2012 at 1:07 PM, Terry Reedy wrote: > 'type-bondage' is the requirement to restrict function inputs and output to > one declared type, where the type declaration mechanisms are usually quite > limited. This is interesting, I hadn't expected that sort of definition. So Haskell is not a type-bondage language? (i.e. it lets you write functions that accept any type via parametric polymorphism, or any type that supports an interface via type classes). > How easy was it to write max, or a universal sort in Java? You write obj.compareTo(other) < 0 instead of using obj < other, and your methods only work on objects (that support the comparable interface). Otherwise, no different than Python, I guess. Would Java not be a type-bondage language if everything was an object? -- Devin