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: 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: <52565598.6000709@gmail.com> <52575e47$0$29984$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Thu, 10 Oct 2013 20:33:37 -0600 Subject: Re: super in Python 3 and variadic arguments To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Thu, Oct 10, 2013 at 8:11 PM, Steven D'Aprano 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)