220 34539 <CADvuK0K81j6BYp4wbkPKfqaRc52vjikCO_Wt-5aDxumLWFgM6w@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "Arthur O'Dwyer" <arthur.j.odwyer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: base and self built-in keywords
Date: Mon, 2 Oct 2017 11:16:05 -0700
Lines: 171
Approved: news@gmane.org
Message-ID: <CADvuK0K81j6BYp4wbkPKfqaRc52vjikCO_Wt-5aDxumLWFgM6w@mail.gmail.com>
References: <ad3fa9d9-b3d1-4650-84bd-d3f6931c9033@isocpp.org>
 <f006604b-cdec-4933-8a79-eb9b25716c7e@isocpp.org> <9dec3353-3142-43d1-928f-b88ac74951bf@isocpp.org>
 <63cb64a8-5add-45ff-a856-364d37042b44@isocpp.org> <c93b4603-ff34-495f-bcd5-c844e8ee0eec@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="94eb2c19516c37cb3e055a945ed9"
X-Trace: blaine.gmane.org 1506968166 3946 195.159.176.226 (2 Oct 2017 18:16:06 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 2 Oct 2017 18:16:06 +0000 (UTC)
Cc: sergeikrivonos@gmail.com
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDLZJYWNDQIONBGKZYCRUBDLILPAI@isocpp.org Mon Oct 02 20:16:00 2017
Return-path: <std-proposals+bncBDLZJYWNDQIONBGKZYCRUBDLILPAI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f70.google.com ([74.125.82.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDLZJYWNDQIONBGKZYCRUBDLILPAI@isocpp.org>)
	id 1dz5G4-0000PZ-7d
	for gclcip-std-proposals@m.gmane.org; Mon, 02 Oct 2017 20:16:00 +0200
Original-Received: by mail-wm0-f70.google.com with SMTP id t69sf1068761wmt.7
        for <gclcip-std-proposals@m.gmane.org>; Mon, 02 Oct 2017 11:16:08 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1506968168; cv=pass;
        d=google.com; s=arc-20160816;
        b=JRwtLtpYSfqgh2ljaUpqL6ixHPEAHIIHN0yBPjpZ+CFGkXqrUwp00r+4IjRFMfrdoj
         BivyFF9votyOnHKYPqFPr6yLLx579PDDWeiYIm2/YHsEuZs6oqDyMc/ICex+lUkCcj+K
         n8Mbj61f5iVdNjxXIMvxvzu4CnGHmjqLRAFRf38hL3EbXpkICFT1+zL+QImRW1zo2jsk
         +k8wDLz4ojQOXRWkHb5GH9Ui3MRCy56jCgNp78BaYIFkAGPOlSqFy+pqIi99xwdlkOyO
         yTPNtcdDRyQNTyi3/zFrty1CtBkzFJM/9SzQVGDFpR1wdbTtW2m9NaPQvLDT5eYKsKTm
         HcEw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:cc:to:subject:message-id
         :date:from:references:in-reply-to:mime-version
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=0pPDCaLnC7S2YFQfIm67l4YqRbXxCNUTwobq305ltXQ=;
        b=nnWAtxGc5tmyIzfz00OSGA8DMtfnjrn2IWwV0NZxYPf6VIZhafj/lG8KTbUJijyDr7
         qSBi8eYbnKgZLtNwxO6mPpHrG9C/VjlKiKbiXg8WRgymSsPWN3Kl8ldDHOH6PfmY1AaO
         ayirCOURTRUrQn+SJz8PKv/QiLX9Ipz/D4T17aOYjab1HQUf6c86YlU1a6VosC9dChG5
         EJsI/bSMypargHpq8ZBTNbRMPTBNouycblx0Xc/giJNXsEnR3ZI+7vPVMGsuN5NNzTY5
         KmGkneVBHkFhCF2oVxsAkcR+6VOqVVDZZVIPqRjVTyW/CDweMaXfG+FJcm7aWI6N9hy/
         jeJA==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=rUUX4cRn;
       spf=pass (google.com: domain of arthur.j.odwyer@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=arthur.j.odwyer@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc:x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=0pPDCaLnC7S2YFQfIm67l4YqRbXxCNUTwobq305ltXQ=;
        b=rDb1Cd9045IOzs1J4bRWZJwNDpkKqAyB/roMIi1my4+JjunCiLZbGIHc0xSHOL1Usu
         haoBN1RriDrF6iZQppBgD1lJflQrHs9LKEzWzTpTq2fJ4r7/scOqhi4kspHXg9YVaYes
         sJC0DOxzhkomGB8sghZh/UllvTau+YZTJNBkmTyfl8AA+46mMT+vyKLFVAp2VaSrY7mc
         elMzTlIHkg+SMRNRsTcY5W6EpEylwBb+8NTDpnZAcPIw45qddGyzLEYxkdlz7jRmttAP
         jFflle7GLdI7nPP2t29sq19QXvwbR2WfUH9WW7vVl4g9kpNfTfvc3inzy+H4vFv/I8Sn
         sjNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:cc:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=0pPDCaLnC7S2YFQfIm67l4YqRbXxCNUTwobq305ltXQ=;
        b=ZOL+iJCzaYrq65hX2q79NcWpsQecsaplg57PSeT4LGRZYJJT/WzfwnULtJqfSpHT3u
         1Al3FmNylnF54VIOzOdm4Hyb4BaZjReoSApj5srTT3YzD5BU03Ms++BCc5t/1zQ4/8VA
         KoCQPvzbbdBwvjA4f7kfiPkvdKb+DuEHysXNtTK5dGFVeabwz0P+W/tiy1iAivN72qmB
         clsAxit1v10/6RYxzS0UA/FXZ6dZBRVMAO66JicDBVXXmUFn4A1RX7f7Dmo3DLJfaYYJ
         q3aV3B8NvXexxmMaZKewsxvx/oXTZP4N5Ly3rLrL2hnGEP6gWwugEFewvwyj5sfw5yWT
         xY3g==
X-Gm-Message-State: AHPjjUi8zwroFnguORuF79CALnTCLBzz2me0DgHtXzqUk+tpSVvzscI+
	vUumvVZYRxXluI9XAGB5lui7cQ==
X-Google-Smtp-Source: AOwi7QBbZWl+U7ekTmAXNaBe747MuBwqpSW0sjLVG0MSDgm3xaUOkTUD2xCjwxfItoRWTRGWmD+amQ==
X-Received: by 10.80.190.11 with SMTP id a11mr3755506edi.4.1506968167959;
        Mon, 02 Oct 2017 11:16:07 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.80.201.70 with SMTP id p6ls6402637edh.3.gmail; Mon, 02 Oct
 2017 11:16:06 -0700 (PDT)
X-Received: by 10.80.172.60 with SMTP id v57mr21193316edc.118.1506968166621;
        Mon, 02 Oct 2017 11:16:06 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1506968166; cv=none;
        d=google.com; s=arc-20160816;
        b=FWAnDbw+NhdjemFKH6J5a/NUU6aCU+RTG6VT40TKdGTAN9CFW3vMJaC1RJnsD+Pof0
         8G2wjM8q42CiSerxyuvxC6fYUbUSomPioMr2MpdoXiTwmwR+ncD4VrAjwC2/LhuXXkbl
         8/7m1Y0a+JrRLFjy/JTX1Lr72jJNEQWMhtlQyrjO2FXk56TzoVE7dLTc66oopiG4skyB
         qLFq1e75LHIjX3oUXxIaYv79YcsSWv9hPZXQ8bnMFC82HNwst7TFh1jqizNpZGEg4vBg
         4e7yG7kqlsllRJtJVUfjA0/jv/1Dsw864mcTR4sVItL+ARwtPd//hDtkq5b1LuXMnKjv
         3tyQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=cc:to:subject:message-id:date:from:references:in-reply-to
         :mime-version:dkim-signature:arc-authentication-results;
        bh=EOM8Cihz5rh8FEoEr4m2+WIwsYrDoHPTRvwMKlOxKc0=;
        b=rtD/X+/iQIZoFeHZvBE7RScOK5ZbzZIa83QpWtXNbDtvMKuseH9gr7o9E1Wkl+clOK
         z5lJdGGaCELvr3FG29AshLSRxxJop2NhNoS04ed+s/4JA9O3gURB74NCJHP62QDyFApI
         IuvvsOu8bWViucOfZKqpoDgd/MElxGd/ipiWeNmnbxQTWUsbYM15RvXKY+AqEEz57pyH
         JQxH46h++Xi1Bpk4VSspLz9AUwU6aEP7hwT6bx0WMOvZtOlHcBabgVzIRiKrh6TyQQpm
         am/WuHD6nJA4daHajrWHh2WtjnCaXuFJQLkQGTx3KiOtV5rJh/1DjNqjZMYW3AqjL7Id
         Hcpw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=rUUX4cRn;
       spf=pass (google.com: domain of arthur.j.odwyer@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=arthur.j.odwyer@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id w51sor5703139edd.54.2017.10.02.11.16.06
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Mon, 02 Oct 2017 11:16:06 -0700 (PDT)
Received-SPF: pass (google.com: domain of arthur.j.odwyer@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.80.143.98 with SMTP id 89mr21055634edy.273.1506968165926;
 Mon, 02 Oct 2017 11:16:05 -0700 (PDT)
Original-Received: by 10.80.202.12 with HTTP; Mon, 2 Oct 2017 11:16:05 -0700 (PDT)
In-Reply-To: <c93b4603-ff34-495f-bcd5-c844e8ee0eec@isocpp.org>
X-Original-Sender: arthur.j.odwyer@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=rUUX4cRn;       spf=pass
 (google.com: domain of arthur.j.odwyer@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=arthur.j.odwyer@gmail.com;       dmarc=pass
 (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:34539
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34539>

--94eb2c19516c37cb3e055a945ed9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 2, 2017 at 7:29 AM, Niall Douglas <nialldouglas14@gmail.com>
wrote:

>
>>>> Python supports multiple inheritance too and I'd suggest you clone
>>> their super() function rather than invent anything new.
>>>
>>
>> Oh dear. Literally anything would be better than Python's super()
>> function.
>> Python invents a sort of linearization of the multiple-inheritance tree =
(the
>> MRO <https://www.python.org/download/releases/2.3/mro/>) so that you can
>> manually call super-class __init__ routines (or not) as you choose; i.e.=
,
>> Python does not have the concept of "constructor" as we understand it in
>> C++. It's more like Objective-C's init routines.
>>
>
> A more accurate explanation is that super() would return the native vtabl=
e
> for the selected inherited class.
>

Yes, but if we were copying Python, it still wouldn't necessarily be the
specific base class that the OP wanted; it would just be the next base
class in the Method Resolution Order. It would have to be determined
dynamically, depending on the most-derived-type of *this.
But I think we're arguing over a hypothetical at this point.

Python's really great. Such a deep well of evil power available to the
> programmer.
>

We agree on both of those sentences. :)



> This blog post <http://www.artima.com/weblogs/viewpost.jsp?thread=3D23627=
5>
>> points out something I'd never consciously considered before: Python has=
 no
>> non-virtual inheritance (I think?).
>>
>
> More that virtual inheritance is the default for all member functions. Yo=
u
> need to explicitly ask to call a non-virtualised implementation, which is
> via super() actually.
>

Well yeah all *dispatch* is virtual. But I meant virtual *inheritance*, i.e=
..

class Animal(object): pass
class Cat(Animal): pass
class Dog(Animal): pass
class CatDog(Cat, Dog): pass

As far as I understand it from like five minutes of research yesterday =E2=
=80=94
so, not a lot =E2=80=94 there's no sense in which CatDog has "two" Animal b=
ase
subobjects.(*) Whereas in C++ it *would* have two Animal base subobjects,
unless you added a couple of "virtual" keywords.

(* =E2=80=93 I am quite possibly wrong. The CatDog does clearly "remember" =
its
Animal member behaviors somehow, so it is not completely far-fetched to me
that it could "remember" its Animal instance variables. But that's not my
*current* mental model of how Python works. Arguably CatDog doesn't even
have *any* Animal "base subobjects" and Python doesn't recognize the
concept of "subobject"; Animal methods work on CatDog only because
duck-typing.)

=E2=80=93Arthur

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CADvuK0K81j6BYp4wbkPKfqaRc52vjikCO_Wt-5aDxumLWFg=
M6w%40mail.gmail.com.

--94eb2c19516c37cb3e055a945ed9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Mon, Oct 2, 2017 at 7:29 AM, Niall Douglas <span dir=3D=
"ltr">&lt;<a href=3D"mailto:nialldouglas14@gmail.com" target=3D"_blank">nia=
lldouglas14@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><=
div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0;m=
argin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"l=
tr"><br></div></blockquote><div>Python supports multiple inheritance too an=
d I&#39;d suggest you clone their super() function rather than invent anyth=
ing new.</div></div></blockquote><div><br></div><div>Oh dear. Literally any=
thing would be better than Python&#39;s super() function.</div><div>Python =
invents a sort of linearization of the multiple-inheritance tree (<a href=
=3D"https://www.python.org/download/releases/2.3/mro/" rel=3D"nofollow" tar=
get=3D"_blank">the MRO</a>) so that you can manually call super-class __ini=
t__ routines (or not) as you choose; i.e., Python does not have the concept=
 of &quot;constructor&quot; as we understand it in C++. It&#39;s more like =
Objective-C&#39;s init routines.</div></div></blockquote><div><br></div><di=
v>A more accurate explanation is that super() would return the native vtabl=
e for the selected inherited class.</div></blockquote><div><br></div><div>Y=
es, but if we were copying Python, it still wouldn&#39;t necessarily be the=
 specific base class that the OP wanted; it would just be the next base cla=
ss in the Method Resolution Order. It would have to be determined dynamical=
ly, depending on the most-derived-type of *this.</div><div>But I think we&#=
39;re arguing over a hypothetical at this point.</div><div><br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div>Python&#39;s really great. Such a deep well o=
f evil power available to the programmer.</div></blockquote><div><br></div>=
<div>We agree on both of those sentences. :)</div><div><br></div><div>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr"><div><a href=3D"http://www.artima.com/weblogs/viewpos=
t.jsp?thread=3D236275" rel=3D"nofollow" target=3D"_blank">This blog post</a=
> points out something I&#39;d never consciously considered before: Python =
has no non-virtual inheritance (I think?). </div></div></blockquote><div><b=
r></div><div>More that virtual inheritance is the default for all member fu=
nctions. You need to explicitly ask to call a non-virtualised implementatio=
n, which is via super() actually.</div></blockquote><div><br></div><div>Wel=
l yeah all <i>dispatch</i> is virtual. But I meant virtual <i>inheritance</=
i>, i.e.</div><div><br></div><div>class Animal(object): pass</div><div>clas=
s Cat(Animal): pass</div><div>class Dog(Animal): pass</div><div>class CatDo=
g(Cat, Dog): pass</div><div><br></div><div>As far as I understand it from l=
ike five minutes of research yesterday =E2=80=94 so, not a lot =E2=80=94 th=
ere&#39;s no sense in which CatDog has &quot;two&quot; Animal base subobjec=
ts.(*) Whereas in C++ it <i>would</i> have two Animal base subobjects, unle=
ss you added a couple of &quot;virtual&quot; keywords.</div><div><br></div>=
<div>(* =E2=80=93 I am quite possibly wrong. The CatDog does clearly &quot;=
remember&quot; its Animal member behaviors somehow, so it is not completely=
 far-fetched to me that it could &quot;remember&quot; its Animal instance v=
ariables. But that&#39;s not my <i>current</i> mental model of how Python w=
orks. Arguably CatDog doesn&#39;t even have <i>any</i> Animal &quot;base su=
bobjects&quot; and Python doesn&#39;t recognize the concept of &quot;subobj=
ect&quot;; Animal methods work on CatDog only because duck-typing.)</div><d=
iv><br></div><div>=E2=80=93Arthur</div></div></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CADvuK0K81j6BYp4wbkPKfqaRc52vjikCO_Wt=
-5aDxumLWFgM6w%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CADvuK0K81j6BYp4w=
bkPKfqaRc52vjikCO_Wt-5aDxumLWFgM6w%40mail.gmail.com</a>.<br />

--94eb2c19516c37cb3e055a945ed9--

.
