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

From Marco Buttu <marco.buttu@gmail.com>
Newsgroups comp.lang.python
Subject Re: super in Python 3 and variadic arguments
Date 2013-10-11 08:17 +0200
Organization Aioe.org NNTP Server
Message-ID <52579809.1040904@gmail.com> (permalink)
References (1 earlier) <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>

Show all headers | 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