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


Groups > comp.lang.python > #109412

Re: Multiple inheritance, super() and changing signature

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Nagy László Zsolt <gandalf@shopzeus.com>
Newsgroups comp.lang.python
Subject Re: Multiple inheritance, super() and changing signature
Date Fri, 3 Jun 2016 14:57:52 +0200
Lines 33
Message-ID <mailman.123.1464958674.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> <85k2i65upp.fsf@benfinney.id.au> <b21d46a9-763a-fe38-b539-77867fcdcdc9@shopzeus.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de odFvQ11mipD1EiVok4omCwIpvEVhqHQLdzB7QZF6uL9A==
Return-Path <gandalf@shopzeus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'initialize': 0.05; 'needed,': 0.05; ':-(': 0.07; 'false.': 0.07; 'override': 0.07; '__init__': 0.09; 'form?': 0.09; 'sake': 0.09; 'useful,': 0.13; 'attributes.': 0.16; 'explicitly,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'right:': 0.16; 'subject:changing': 0.16; 'sugar': 0.16; 'syntactic': 0.16; 'useless': 0.16; 'example.': 0.18; 'affected': 0.22; 'class,': 0.22; 'explicit': 0.22; 'pass': 0.22; 'leave': 0.23; 'this:': 0.23; 'tried': 0.24; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'that.': 0.30; 'call.': 0.30; 'class.': 0.30; 'raymond': 0.30; 'statement': 0.32; 'point': 0.33; 'useful': 0.33; 'class': 0.33; 'covered': 0.34; 'something': 0.35; 'but': 0.36; 'instead': 0.36; 'there': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'method': 0.37; 'one,': 0.37; 'seem': 0.37; '(with': 0.38; 'anything': 0.38; 'does': 0.39; 'expressed': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'default': 0.61; 'show': 0.62; 'watch': 0.62; 'different': 0.63; 'skip:\xe2 10': 0.70; '8bit%:43': 0.72; 'sound': 0.72; 'quality': 0.72; 'video,': 0.79
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopzeus.com; s=shopzeus_com; t=1464958673; bh=m3LABR/vgAmNTku/JTFMeh+j6t8r1FXlNecqqwU0uhY=; h=Subject:To:References:From:Date:In-Reply-To:From; b=IhFI8VVCY54EFrGXiCvrbwCGmhYpijM0yOSrBCaW+HvUC0k9Uf9KfoYeSYzkk41N5 E18IVVbgGbMfXeXwGg9B3Z7BZS5DL08U2mF5yw7deS+VXv1IZLGFFiDIFLxqVipJND 7pfycGX4UayXoFfXWKtB3y1hcTujp5Rn5IWaTiI8t3+aMoNXYXAIK6ZLvTKn3OP/dT VmSU/D6/hP4NCabuCDaWK54C9po/1A/DE5aNyXBQs6mP2KCKX4v6USqHZsGCcEavGQ pIS8Pc+x8X4gYdOTo4sa49uAu+SWuSI0Sl2AY7J1pVpag/OYcdlieDJgq+OurWfuW+ QeZxCvrAVm4nw==
In-Reply-To <85k2i65upp.fsf@benfinney.id.au>
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 <b21d46a9-763a-fe38-b539-77867fcdcdc9@shopzeus.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> <85k2i65upp.fsf@benfinney.id.au>
Xref csiph.com comp.lang.python:109412

Show key headers only | View raw



>> But I have to initialize some default attributes.
> Then the statement “there is NOTHING else here” must be false. Either
> the custom ‘__init__’ does something useful, or it doesn't.
Well... the custom __init__ method with nothing else just a super() call
was expressed there to show the super() call explicitly, and to
emphasize that in that particular class, super() is used instead of an
explicit base method call. It is not a pattern to be followed, just
syntactic sugar for the sake of the example.

So you are right: the custom __init__ in the  BootstrapDesktop class is
not really needed, and does not do anything useful in that particular
class.

My original statement was this: "I have to initialize some default
attributes", and for that I need to pass arguments. The truthness of
this statement is not affected by adding a useless override of a method
(with the very same parameters). Even though I see that you are right in
what you wrote, I think I don't understand the point because it seem
unrelated.

> All this is covered in Raymond Hettinger's material, so it's best that I
> just leave you to read that.
>
Is it available in written form? I have tried to watch the video, but
the sound quality is so poor that I cannot understand. I have tried to
search for a better one, but that is a different one. :-(

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