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


Groups > comp.lang.python > #56634

Re: super in Python 3 and variadic arguments

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!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'subject:Python': 0.06; 'compiler': 0.07; 'def': 0.12; 'creates': 0.14; 'arg):': 0.16; 'fail,': 0.16; 'fine.': 0.16; 'sees': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'hack': 0.22; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'work:': 0.31; 'class': 0.32; 'received:google.com': 0.35; 'method': 0.36; 'being': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'within': 0.65; 'actually,': 0.84; 'side-effects': 0.84; '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:from:date:message-id:subject:to :content-type; bh=y7VksZKazkv+vQ/hY4A/m3t/+oWws96wJSzeXNfkqLw=; b=Hk1TGmRGFU0zkyNJGeqKNlbaxfNue214cZxoEW0Hy4Yhd67qxab9d0E7hMFgV6AsVl xTKRXXlv64K5yLEtZYHEc3qLt0IL/DD+TzjPehylDakzgnVcpqH3D5YKlGCXE/cKcW86 CvG9C8zqpMKRXWmII04qMVf0zbT1DLFScpgollB/GiiTbxjtxJkqKURi0FScjL8+xRoC wRx7iZNp8MCBITBXBRjpsRDsVB01KuPi9Ob7nQiJTHY+KvvGxVvdi7e/mZftxGcKJiuI AfwfFthw0w5olgLR57G3fkB0Mv2F9sqEnifpsxtuwq3c7ClGyT2bMpMMi48rBCuNQM19 vyrA==
X-Received by 10.14.172.133 with SMTP id t5mr25071691eel.35.1381458857672; Thu, 10 Oct 2013 19:34:17 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <52575e47$0$29984$c3e8da3$5496439d@news.astraweb.com>
References <l33tlf$rr1$1@speranza.aioe.org> <mailman.902.1381337680.18130.python-list@python.org> <52565598.6000709@gmail.com> <mailman.932.1381403081.18130.python-list@python.org> <52575e47$0$29984$c3e8da3$5496439d@news.astraweb.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 10 Oct 2013 20:33:37 -0600
Subject Re: super in Python 3 and variadic arguments
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
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.977.1381458865.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1381458865 news.xs4all.nl 15915 [2001:888:2000:d::a6]:55914
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:56634

Show key headers only | View raw


On Thu, Oct 10, 2013 at 8:11 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> One of the side-effects of this being a hack is that this doesn't work:
>
> class X(Y):
>     def method(self, arg):
>         f = super
>         f().method(arg)

Actually, that works just fine.  The compiler sees that super is
accessed within the method and creates the closure necessary to make
it work.  This does fail, however:

f = super
class X(Y):
    def method(self, arg):
        f().method(arg)

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


Thread

super in Python 3 and variadic arguments Marco Buttu <marco.buttu@gmail.com> - 2013-10-09 17:44 +0200
  Re: super in Python 3 and variadic arguments Ned Batchelder <ned@nedbatchelder.com> - 2013-10-09 12:47 -0400
    Re: super in Python 3 and variadic arguments Marco Buttu <marco.buttu@gmail.com> - 2013-10-10 09:22 +0200
      Re: super in Python 3 and variadic arguments Ned Batchelder <ned@nedbatchelder.com> - 2013-10-10 07:04 -0400
        Re: super in Python 3 and variadic arguments Marco Buttu <marco.buttu@gmail.com> - 2013-10-10 14:54 +0200
        Re: super in Python 3 and variadic arguments Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-11 02:11 +0000
          Re: super in Python 3 and variadic arguments Ian Kelly <ian.g.kelly@gmail.com> - 2013-10-10 20:33 -0600
            Re: super in Python 3 and variadic arguments Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-11 03:00 +0000
              Re: super in Python 3 and variadic arguments Chris Angelico <rosuav@gmail.com> - 2013-10-11 17:08 +1100
            Re: super in Python 3 and variadic arguments Marco Buttu <marco.buttu@gmail.com> - 2013-10-11 08:17 +0200
          Re: super in Python 3 and variadic arguments Marco Buttu <marco.buttu@gmail.com> - 2013-10-11 08:15 +0200

csiph-web