Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #61446
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| 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; 'list?': 0.07; 'subject:help': 0.08; '"if': 0.09; 'arrays': 0.09; 'blue': 0.09; 'linear': 0.09; 'method,': 0.09; 'methods,': 0.09; 'mi,': 0.09; 'okay': 0.09; 'type,': 0.09; 'worked,': 0.09; 'python': 0.11; "wouldn't": 0.14; '"it\'s': 0.16; '1981,': 0.16; 'bit...': 0.16; 'exactly?': 0.16; 'for,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inheritance': 0.16; 'itself,': 0.16; 'skips': 0.16; 'subclasses.': 0.16; 'subject:object': 0.16; 'weird.': 0.16; 'component': 0.16; 'wrote:': 0.18; 'normally': 0.19; 'work,': 0.20; 'machine': 0.22; 'memory': 0.22; 'to:name :python-list@python.org': 0.22; 'java': 0.24; 'mon,': 0.24; "haven't": 0.24; "i've": 0.25; 'source': 0.25; 'class.': 0.26; 'define': 0.26; 'second': 0.26; 'asking': 0.27; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'chris': 0.29; 'feature': 0.29; 'array': 0.29; "doesn't": 0.30; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; 'getting': 0.31; 'that.': 0.31; 'alan': 0.31; 'writes:': 0.31; 'class': 0.32; 'quite': 0.32; 'says': 0.33; 'worked': 0.33; 'comment': 0.34; 'subject:the': 0.34; 'classes': 0.35; 'created': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'c++': 0.36; 'instances': 0.36; 'largely': 0.36; 'method': 0.36; 'should': 0.36; 'detail': 0.37; 'virtual': 0.37; 'starting': 0.37; 'implement': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'anything': 0.39; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'impact': 0.61; 'mentioned': 0.61; "you're": 0.61; 'reach': 0.63; 'such': 0.63; 'july': 0.63; 'more': 0.64; 'different': 0.65; 'guided': 0.68; 'real-world': 0.68; 'results': 0.69; '4th': 0.74; '_if_': 0.84; 'encounters': 0.84; 'here!': 0.84; 'manual,': 0.84; 'pike': 0.84; 'resolution,': 0.84; 'subject:base': 0.84; 'tricky': 0.84; 'years!': 0.84; 'edition,': 0.91; 'imagine': 0.93; 'rocket': 0.95; '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:date:message-id:subject:from:to :content-type; bh=hR9WZBaDGOe9e7nHZHZqbqNWrFHXmXccrls4M/lGWbc=; b=X/p1eh9J71O2kVnfcatgof1qcC0RPTnL8Si1z9oC2NoYU3aoAbe91zuSk/5i+YWPyx aG+3aEcp1Zrr236RUdQFiCzk9Ve8l+GTzn45rESU8lxwwma5doGMz0E1cRh6wKEinJ9u AD7jPpZDx1oHfVP8U8QPJg/Jl6CuZvgkHfqdDWhGhabGZlfvpQoBFkHvhWaBC0FeLwV2 lCN3Dn37Y5Le1KGe3IbhtYxM6ayDWMxpfIrzMIlPTKMy6xy0BYgHYkBaOusfAkmyQdMm YO7U4N0htWr4V3biKdVslYzzHOQVqXIta5sU61sXQ76nHQVyCPJT3RWCYyfUhuBAYyXI 8txA== |
| MIME-Version | 1.0 |
| X-Received | by 10.66.66.42 with SMTP id c10mr25419992pat.98.1386654288276; Mon, 09 Dec 2013 21:44:48 -0800 (PST) |
| In-Reply-To | <w2d4n6he0no.fsf@scooby-doo.csail.mit.edu> |
| References | <l7t00b$hp7$1@ger.gmane.org> <l7tu0b$s3o$1@ger.gmane.org> <mailman.3748.1386546562.18130.python-list@python.org> <l833rs$jik$1@dont-email.me> <mailman.3752.1386553439.18130.python-list@python.org> <52a52b98$0$2762$c3e8da3$76491128@news.astraweb.com> <mailman.3753.1386556915.18130.python-list@python.org> <52a558c2$0$2762$c3e8da3$76491128@news.astraweb.com> <w2da9gaeb0r.fsf@scooby-doo.csail.mit.edu> <mailman.3763.1386576267.18130.python-list@python.org> <w2d4n6he0no.fsf@scooby-doo.csail.mit.edu> |
| Date | Tue, 10 Dec 2013 16:44:48 +1100 |
| Subject | Re: interactive help on the base object |
| From | Chris Angelico <rosuav@gmail.com> |
| To | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3811.1386654693.18130.python-list@python.org> (permalink) |
| Lines | 48 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1386654693 news.xs4all.nl 2833 [2001:888:2000:d::a6]:56862 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:61446 |
Show key headers only | View raw
On Tue, Dec 10, 2013 at 4:27 PM, Alan Bawden <alan@scooby-doo.csail.mit.edu> wrote: > Chris Angelico <rosuav@gmail.com> writes: > >> On Mon, Dec 9, 2013 at 6:31 PM, Alan Bawden >> ... >> How does that work, exactly? How do you have a class inherit >> (ultimately) from itself, and how does that impact the component class >> list? > > How does it work "exactly"? You're asking me about a feature I never > made use of, in a system I have no source for, and that I haven't used > in over 25 years! If it wasn't mentioned in a parenthetical comment in > the 32-year-old documentation I still have on my bookshelf (Lisp Machine > Manual, 4th edition, July 1981, blue cover), I wouldn't trust my own > memory that such a thing ever even existed. > > So you're not getting anything "exact" here! LOL! > I have no idea exactly how it worked, but imagine something that walked > the superclass graph _as_ _if_ it was a tree, collected classes in some > order, and that just skips any class it encounters for the second time. > That results in _some_ linear ordering of all the classes you can reach > from the starting class. Now use that. Ow, that sounds a bit... weird. I think I prefer an acyclic graph for inheritance! A few weirdnesses are necessary for bootstrapping - type(object) is type, type(type) is type, and type.__bases__ = (object,) - but normally every type should be created before all instances of it, and every superclass before all its subclasses. But of course, *multiple* inheritance is always weird. I've worked in some detail with four systems (C++, Python, Pike, Java), and they're all quite different in how they handle MI. Java says "There is no MI... but you can implement multiple interfaces". C++ says "There is MI and there is virtual MI, and if one of them doesn't do your head in, the other will". Python says "It's all about method resolution, instance data is separate, so make sure everything cooperates". Pike says "If both parents define a method, super() will return an array of methods, but that's okay because arrays are callable". It's a fundamentally tricky problem, largely because every real-world analogy we can muster is going to end up looking more like composition than inheritance (a guided missile is-a bomb and is-a rocket, but it's just as valid to say it is-a rocket and it has-a bomb). ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: interactive help on the base object Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-08 23:48 +0000
Re: interactive help on the base object Denis McMahon <denismfmcmahon@gmail.com> - 2013-12-09 00:45 +0000
Re: interactive help on the base object Mark Janssen <dreamingforward@gmail.com> - 2013-12-08 17:09 -0800
Re: interactive help on the base object Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-09 01:38 +0000
Re: interactive help on the base object Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-09 01:43 +0000
Re: interactive help on the base object Steven D'Aprano <steve@pearwood.info> - 2013-12-09 02:31 +0000
Re: interactive help on the base object Mark Janssen <dreamingforward@gmail.com> - 2013-12-08 18:41 -0800
Re: interactive help on the base object rusi <rustompmody@gmail.com> - 2013-12-08 18:58 -0800
Re: interactive help on the base object Steven D'Aprano <steve@pearwood.info> - 2013-12-09 04:16 +0000
Re: interactive help on the base object rusi <rustompmody@gmail.com> - 2013-12-08 20:46 -0800
Re: interactive help on the base object rurpy@yahoo.com - 2013-12-08 21:26 -0800
Re: interactive help on the base object rusi <rustompmody@gmail.com> - 2013-12-08 22:44 -0800
Re: interactive help on the base object Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-09 09:44 +0000
Re: interactive help on the base object Steven D'Aprano <steve@pearwood.info> - 2013-12-09 05:44 +0000
Re: interactive help on the base object Alan Bawden <alan@scooby-doo.csail.mit.edu> - 2013-12-09 02:31 -0500
Re: interactive help on the base object Chris Angelico <rosuav@gmail.com> - 2013-12-09 18:39 +1100
Re: interactive help on the base object Alan Bawden <alan@scooby-doo.csail.mit.edu> - 2013-12-10 00:34 -0500
Re: interactive help on the base object Chris Angelico <rosuav@gmail.com> - 2013-12-10 16:44 +1100
Re: interactive help on the base object Chris Angelico <rosuav@gmail.com> - 2013-12-09 13:57 +1100
Re: interactive help on the base object Terry Reedy <tjreedy@udel.edu> - 2013-12-09 00:00 -0500
Re: interactive help on the base object Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-09 23:48 +0000
Re: interactive help on the base object Steven D'Aprano <steve@pearwood.info> - 2013-12-09 01:58 +0000
csiph-web