Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Marco Buttu 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> References: <52565598.6000709@gmail.com> <52575e47$0$29984$c3e8da3$5496439d@news.astraweb.com> 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 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