Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109420

Re: Multiple inheritance, super() and changing signature

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Michael Selik <michael.selik@gmail.com>
Newsgroups comp.lang.python
Subject Re: Multiple inheritance, super() and changing signature
Date Fri, 03 Jun 2016 15:33:11 +0000
Lines 20
Message-ID <mailman.127.1464968009.1839.python-list@python.org> (permalink)
References <80ea0ea1-5468-2dee-2c38-c2b09801d0f1@shopzeus.com> <mailman.54.1464711627.1839.python-list@python.org> <574e45f4$0$1611$c3e8da3$5496439d@news.astraweb.com> <a17955cb-04d3-9dd6-e2b3-4719269f241d@shopzeus.com> <d91f49c5-4572-9cc4-9688-b4b3ffbce691@shopzeus.com> <CALwzidnc=Yws6gSOpt_spYWGTJkq4zOuUmcVNuyF6Xuv3dK++Q@mail.gmail.com> <CAGgTfkO4g1bdBhZzZ4gaOgFRWOBXSgM4=uuPYWEFFDQBWSQVhw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de kfrMaTvUyttpflnRleWoVw2nw0sN6MrhSzU/LGqSEl/w==
Return-Path <michael.selik@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.037
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'classes,': 0.05; 'attribute.': 0.09; '2016': 0.16; 'hierarchy,': 0.16; 'inheritance': 0.16; 'involved,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:changing': 0.16; 'wrote:': 0.16; 'attribute': 0.18; '&gt;': 0.18; 'email addr:gmail.com&gt;': 0.18; 'to:2**1': 0.21; 'parameter': 0.22; 'am,': 0.23; 'header:In-Reply- To:1': 0.24; "i've": 0.25; 'fri,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'back.': 0.27; 'classes': 0.30; "can't": 0.32; 'class': 0.33; 'problem': 0.33; "i'll": 0.33; 'received:google.com': 0.35; 'so,': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'names': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'some': 0.40; 'share': 0.61; 'bases': 0.63; 'more': 0.63; 'different': 0.63; 'hear': 0.64; "they're": 0.66; 'nagy': 0.84; 'to:name:python': 0.84; 'cooperative': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=A1LcmlQtxR9OeLW0TFScKATO1ViQ5eZDEXEf4C3MO+o=; b=J+021WxM/L83qcQVqzg9U+0lMzAbOKtkGVkJnz+bv2QxqVudVt9JFUWiFtJS5rtAre A7PY0HgcZCOfBOfVt07jduvoIrBM9tlt+y0WNfwZ34d4YikHw/4F3I9ZJc6Mxd75WWGB 6h1+YxHwTeizJZUhz/o1YLbmbwYoA2K6NJYXnUzlRsIw1xyuhqQkPMtk4TC4Zu7hgLqj oWjyTppoAiwFZeHp++9L+/9p1FTOTg5a+hnzTsli88KEpH+8b70VGxBWa41fBLUkVyLZ 0lfoG5c4ASR2zp9jq09DBfyT6m4/zb5Axl2J0DzZtpl0grIBYnw4lcNc+lSL0be25JCE PKKg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=A1LcmlQtxR9OeLW0TFScKATO1ViQ5eZDEXEf4C3MO+o=; b=cyGiBKQ4BuAseF2m55jaAWQEiT5Yg4t1i+CGGcwhrhrB0vFmfAk0YNIyWnbzvDJ1HG GTqMKTtGBpuH4xVEOjaXDq551DAedcEQgDlVieN+3pXJZyIVdbW0aMMGTzwX6/kt2U34 fkwKbo+pF577H+aq6eZc7pJcZWg6YpOmcng0kYJaLbqqCe4MnSoV56c7FPV0l9TxHV6M dwTnMfATIjks/Z6DvDf3wr9p46eHaqZAV+nlbdULkF0kXdLfeTW5sML16ZYhATY2Vyxk l8Ivu9A25/Vlq59CEN36j8ykPv0Lwr6lKD+0xsSsoKQZbZjOIz3CLmM7CvR2GNrQ9krC +rzg==
X-Gm-Message-State ALyK8tJgtX/XyoRgNTMfbLUiim3DSAZ5pBpUqvlXiTw8ukhU58gJVyLOYwYpj4hUW0hqOs/Qht0pzO7I1opG0A==
X-Received by 10.140.39.166 with SMTP id v35mr3458507qgv.93.1464968001580; Fri, 03 Jun 2016 08:33:21 -0700 (PDT)
In-Reply-To <CALwzidnc=Yws6gSOpt_spYWGTJkq4zOuUmcVNuyF6Xuv3dK++Q@mail.gmail.com>
X-Content-Filtered-By Mailman/MimeDel 2.1.22
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <CAGgTfkO4g1bdBhZzZ4gaOgFRWOBXSgM4=uuPYWEFFDQBWSQVhw@mail.gmail.com>
X-Mailman-Original-References <80ea0ea1-5468-2dee-2c38-c2b09801d0f1@shopzeus.com> <mailman.54.1464711627.1839.python-list@python.org> <574e45f4$0$1611$c3e8da3$5496439d@news.astraweb.com> <a17955cb-04d3-9dd6-e2b3-4719269f241d@shopzeus.com> <d91f49c5-4572-9cc4-9688-b4b3ffbce691@shopzeus.com> <CALwzidnc=Yws6gSOpt_spYWGTJkq4zOuUmcVNuyF6Xuv3dK++Q@mail.gmail.com>
Xref csiph.com comp.lang.python:109420

Show key headers only | View raw


On Fri, Jun 3, 2016 at 10:41 AM Ian Kelly <ian.g.kelly@gmail.com> wrote:

> On Fri, Jun 3, 2016 at 8:06 AM, Nagy László Zsolt <gandalf@shopzeus.com>
> wrote:
> > There is still something I don't get: how to create cooperative classes
> > when some base classes share some of the parameters?
>
> Why do they need to share the same parameter?
>

Is the problem that the attribute or parameter has the same name in both
base classes, but has different meanings in each?

If so, and you're in control of every class in the inheritance hierarchy,
perhaps you can come up with more specific names so that the bases no
longer share the same attribute.

If you can't change the base classes, I've got some other solutions, but
they're more involved, so I'll wait to hear back.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Multiple inheritance, super() and changing signature Nagy László Zsolt <gandalf@shopzeus.com> - 2016-05-31 18:10 +0200
  Re: Multiple inheritance, super() and changing signature Steven D'Aprano <steve@pearwood.info> - 2016-06-01 12:18 +1000
    Re: Multiple inheritance, super() and changing signature Nagy László Zsolt <gandalf@shopzeus.com> - 2016-06-03 14:10 +0200
      Re: Multiple inheritance, super() and changing signature Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-04 13:06 +1200
        Re: Multiple inheritance, super() and changing signature Steven D'Aprano <steve@pearwood.info> - 2016-06-04 12:51 +1000
          Re: Multiple inheritance, super() and changing signature Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-04 23:50 +1200
        Re: Multiple inheritance, super() and changing signature Ian Kelly <ian.g.kelly@gmail.com> - 2016-06-03 23:05 -0600
          Re: Multiple inheritance, super() and changing signature Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-04 23:52 +1200
            Re: Multiple inheritance, super() and changing signature Steven D'Aprano <steve@pearwood.info> - 2016-06-04 23:46 +1000
              Re: Multiple inheritance, super() and changing signature Nagy László Zsolt <gandalf@shopzeus.com> - 2016-06-04 16:42 +0200
    Re: Multiple inheritance, super() and changing signature Ben Finney <ben+python@benfinney.id.au> - 2016-06-03 22:21 +1000
      Re: Multiple inheritance, super() and changing signature Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-04 13:10 +1200
    Re: Multiple inheritance, super() and changing signature Nagy László Zsolt <gandalf@shopzeus.com> - 2016-06-03 14:14 +0200
    Re: Multiple inheritance, super() and changing signature Nagy László Zsolt <gandalf@shopzeus.com> - 2016-06-03 14:57 +0200
    Re: Multiple inheritance, super() and changing signature Nagy László Zsolt <gandalf@shopzeus.com> - 2016-06-03 16:06 +0200
    Re: Multiple inheritance, super() and changing signature Ian Kelly <ian.g.kelly@gmail.com> - 2016-06-03 08:39 -0600
    Re: Multiple inheritance, super() and changing signature Michael Selik <michael.selik@gmail.com> - 2016-06-03 15:33 +0000
    Re: Multiple inheritance, super() and changing signature Nagy László Zsolt <gandalf@shopzeus.com> - 2016-06-03 17:59 +0200
    Re: Multiple inheritance, super() and changing signature Michael Selik <michael.selik@gmail.com> - 2016-06-03 16:28 +0000
    Re: Multiple inheritance, super() and changing signature Ben Finney <ben+python@benfinney.id.au> - 2016-06-04 06:16 +1000
    Re: Multiple inheritance, super() and changing signature Ben Finney <ben+python@benfinney.id.au> - 2016-06-04 06:19 +1000
    Re: Multiple inheritance, super() and changing signature Ian Kelly <ian.g.kelly@gmail.com> - 2016-06-03 15:53 -0600
    Re: Multiple inheritance, super() and changing signature Ben Finney <ben+python@benfinney.id.au> - 2016-06-04 10:44 +1000

csiph-web