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


Groups > comp.lang.python > #56651

Re: super in Python 3 and variadic arguments

Path csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From Marco Buttu <marco.buttu@gmail.com>
Newsgroups comp.lang.python
Subject Re: super in Python 3 and variadic arguments
Date Fri, 11 Oct 2013 08:17:45 +0200
Organization Aioe.org NNTP Server
Lines 23
Message-ID <52579809.1040904@gmail.com> (permalink)
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> <mailman.977.1381458865.18130.python-list@python.org>
NNTP-Posting-Host JwqZ/gzgbBjmDI8Wc3dIWg.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.python:56651

Show key headers only | View raw


On 10/11/2013 04:33 AM, Ian Kelly wrote:

> On Thu, Oct 10, 2013 at 8:11 PM, Steven D'Aprano

>> >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)

Very interesting! Thanks :)
-- 
Marco Buttu

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