Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'c++,': 0.07; 'alain': 0.09; 'cc:addr:python-list': 0.11; 'mostly': 0.14; '9:20': 0.16; '[2].': 0.16; 'c++.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ought': 0.16; 'overriding': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'class.': 0.26; 'mention': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'accidentally': 0.31; 'fri,': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'c++': 0.36; "didn't": 0.36; 'method': 0.36; 'pm,': 0.38; 'called': 0.40; 'how': 0.40; 'up,': 0.60; 'happen': 0.63; 'risk': 0.72; 'subject:This': 0.74; "class's": 0.84; 'to:none': 0.92 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:cc :content-type; bh=lS9cRS8fu4RE6cxki3TAA5H6OWWTvcTXH8xHol5k0WA=; b=PV63XCrA1nIb65q2umBpGZky+O/j4Ck9f/8AGzC/n/sSS2S87T4K8+/gFCZ05PqQG/ 6Xrlblg9lg9hxiKWnGuSvAVBFARf20SV/I+gFCOalGQdREcSVEPnFuK6KIpmI3RGaLnk C0QG8iSBqmw5fy4l1zjgpJN18Pzhyb40A7ZfTioFo9GrMIynADjfwxjvn+i1bdmrx4Q8 ECdYNqnberc4Lyc58kzeMNjtokaTOpKEc6V7suxaSs3UIMBfCZwpGU+uBtPWWUyms8VT ciPxt06TO+tXAWxqAxdR9QOLWO/pn+8ULIHJak6pNzOQzEN1LiXmFRq2XVFDoSKKqh0a U6Tw== MIME-Version: 1.0 X-Received: by 10.58.39.129 with SMTP id p1mr2402284vek.69.1402057431329; Fri, 06 Jun 2014 05:23:51 -0700 (PDT) In-Reply-To: <87sininv2y.fsf@dpt-info.u-strasbg.fr> References: <8738fjkc2w.fsf@dpt-info.u-strasbg.fr> <87tx7zi0i1.fsf@dpt-info.u-strasbg.fr> <87sininv2y.fsf@dpt-info.u-strasbg.fr> Date: Fri, 6 Jun 2014 22:23:51 +1000 Subject: Re: OT: This Swift thing From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402057433 news.xs4all.nl 2887 [2001:888:2000:d::a6]:55521 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72840 On Fri, Jun 6, 2014 at 9:20 PM, Alain Ketterlin wrote: >> It's impossible to accidentally call a base class's method when you >> ought to have called the overriding method in the subclass, which is a >> risk in C++ [2]. > > I don't how this can happen in C++, unless you actually have an instance > of the base class. Anyway, I didn't mention C++. Mostly if you forget to declare the method 'virtual'; there are other ways to muck things up, but that's the main one. ChrisA