Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'ideally': 0.04; 'class,': 0.07; 'developer.': 0.07; 'suppose': 0.07; 'attributes': 0.09; 'integers': 0.09; 'python': 0.11; 'language.': 0.14; 'useful,': 0.14; 'changes': 0.15; 'belongs': 0.16; 'distinct': 0.16; 'interpreter,': 0.16; 'janssen': 0.16; 'mean,': 0.16; 'objects.': 0.16; 'subject:object': 0.16; 'type)': 0.16; 'types,': 0.16; 'wrote:': 0.18; '(the': 0.22; 'machine': 0.22; 'programming': 0.22; 'example.': 0.24; 'integer': 0.24; 'sort': 0.25; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'ideal': 0.29; "doesn't": 0.30; 'is?': 0.30; 'sets': 0.30; 'message- id:@mail.gmail.com': 0.30; 'that.': 0.31; '25,': 0.31; 'argue': 0.31; 'grouping': 0.31; 'sets.': 0.31; 'terms.': 0.31; 'waters': 0.31; 'class': 0.32; 'subject:the': 0.34; 'could': 0.34; 'basic': 0.35; "can't": 0.35; 'classes': 0.35; 'common': 0.35; 'objects': 0.35; "who's": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'instances': 0.36; 'method': 0.36; 'example,': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'that,': 0.38; 'expect': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'how': 0.40; 'ensure': 0.60; 'most': 0.60; 'new': 0.61; "you're": 0.61; "you'll": 0.62; 'skip:n 10': 0.64; 'within': 0.65; 'anything.': 0.68; 'combining': 0.68; 'lowest': 0.74; 'atomic': 0.84; 'perspective,': 0.84; 'sets,': 0.84; 'contracts': 0.93; '2013': 0.98 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=/JpJDdWJMYR9VreqM9GukCiyAeqw/lJAIc2Fq1qbDx0=; b=EvcAcO8r/17fKdaowayCjF9sObVy+fD91GOMTmti4bU/f8/PjldcgtYKjXpxhcCSBm onFxPahDwR1sB16wf8Wi45+6sEIHezTDLFM1mcg+xg9GBPzxQXwOeO0jA7II6ZhBdj6q gSl9P3r6h6QGfdZkL10LCgBFWb8AMJYRRSNUpgoylvz52D2sYFNFNc1+BGBgwkMKgUmT WUHIGmwLhieeuoazroeX4rrQq6moqiqfikYfHe/iIG+7jraYPDtQD0noetLNH1+toq1T ucND3Ta8vKPlbaJ+0StGeq1QV/WqYvYFA/YYUdV/GLeq8cjDnWXxPRoHhzpkI0kItQll XHuw== X-Received: by 10.66.27.172 with SMTP id u12mr1848690pag.209.1372201665521; Tue, 25 Jun 2013 16:07:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <15ba0011-bbf1-42f7-b3ea-1c1d4b70e56b@googlegroups.com> <51c66962$0$29999$c3e8da3$5496439d@news.astraweb.com> <20130623133546.GA2308@capricorn> <51c723b4$0$29999$c3e8da3$5496439d@news.astraweb.com> <51C74D6E.6030200@rece.vub.ac.be> From: Ian Kelly Date: Tue, 25 Jun 2013 17:07:05 -0600 Subject: Re: What is the semantics meaning of 'object'? To: Python Content-Type: text/plain; charset=ISO-8859-1 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372201668 news.xs4all.nl 16004 [2001:888:2000:d::a6]:38771 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49207 On Tue, Jun 25, 2013 at 4:38 PM, Mark Janssen wrote: > Sorry my last message got sent prematurely. Retrying... > >> So instead of super(), you would have sub()? It's an interesting >> concept, but I don't think it changes anything. You still have to >> design your classes cooperatively if you expect to use them with >> multiple inheritance. > > Yes, and let new instances of the child classes automatically ensure > the contracts of the parent classes -- managed within the Python > interpreter, not the developer. It sounds like you want to be using Eiffel, not Python. > As for sub(), I suppose it could be called delegate(). You can call it that, but you'll just be muddying the waters since there's already a perfectly good pattern by that name, which involves having multiple distinct objects and has nothing to do with inheritance. > The issue of classes cooperating isn't as big as it seems, because > since you're working now from a useful, agreed-upon common base (the > non-negotiable, but also non-arbitrary) machine types, you're now all > (the python and ideally the *object* community) speaking the same > language. Who's going to argue about integers (as the atomic type) > and sets (as the most basic grouping type) being THE common set of > bases for everything else? I mean, it doesn't get anymore ideal and > pure than integers and sets. Combining integers with sets I can make > a Rational class and have infinite-precision arithmetic, for example. I don't see how this solves anything. At some point you have to be able to add methods and attributes to your objects. For example, your Rational class is going to need some sort of "reduce" method to reduce a Rational instance to lowest terms. That's not a method that belongs on an integer or set type. If you can't add functionality, then all you will ever have are integers and sets, and if you can add functionality, then what difference does it make what your fundamental base class is? >From a programming perspective, I think it is proper that "object" is the most fundamental base class, because all it has is identity. Integers and sets add other functionality on top of that.