Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'modify': 0.04; 'guido': 0.05; 'model,': 0.05; 'extent': 0.07; 'creighton': 0.09; 'methods,': 0.09; 'received:internal': 0.09; 'python': 0.11; 'argument': 0.15; 'accident.': 0.16; 'argument)': 0.16; 'did.': 0.16; 'hypothetical': 0.16; 'list),': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'case.': 0.18; 'laura': 0.18; '(the': 0.22; 'decorator': 0.22; 'module': 0.23; 'header:In-Reply- To:1': 0.24; 'equivalent': 0.27; 'feature,': 0.29; 'url:2008': 0.29; 'url:se': 0.29; '(which': 0.29; 'function': 0.30; 'keyword': 0.31; 'window': 0.31; 'skip:s 30': 0.31; "can't": 0.32; 'implement': 0.32; 'class': 0.33; 'decorators': 0.33; 'doubt': 0.33; 'subject:?': 0.34; 'to:addr:python-list': 0.35; 'really': 0.35; "isn't": 0.35; 'but': 0.36; 'there': 0.36; 'possible': 0.36; '(and': 0.36; 'subject:" ': 0.36; 'received:10': 0.37; 'subject:: ': 0.37; 'tue,': 0.38; 'received:66': 0.38; 'method': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'some': 0.40; 'from:no real name:2**0': 0.61; 'header:Message-Id:1': 0.62; 'more': 0.62; '26,': 0.72; 'worth': 0.73; 'url:10': 0.79; 'lacks': 0.84; 'misses': 0.84; 'presumably': 0.84; 'subject:self': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Z9JIuGP0bAWE4KyIVx9HiJeaVGc=; b=HtwCSw EkHkwqh0w1IIUbQOT7GtRBfp1vMZPhbC7/d0ksqYyPBru7BHb+AeIcxuywA/99pI j6AcrTUsCnBaBsQtN16fih5qEupKEf2LZlhObLYSbMdwuqFk2fmsBFlcO0vK4Jdu 3nGF7RT4xDBIbSah2Y/p6i1ef/Os11qamMBBk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Z9JIuGP0bAWE4Ky IVx9HiJeaVGc=; b=qXVto+NRZYCJkKRCKiOdbXHmGeABq8u5uDICwdwzkk01Low 9cl6V8hkEYqod/t35QZajouuUlNgld+XJDSByqL2eAu8yEZaqk7vJnXa0kChP2Rd YC8yCfar9wolBCNoGWQqFyXSqi5wOGeIwLPtx20rNz170yGCWWOTvHGwA6aw= X-Sasl-Enc: Ktq9SFpobAKoQntUbxkHdQ/9uMX7mvynYw5j+N3G3EqE 1432663902 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-073992ec Subject: Re: should "self" be changed? Date: Tue, 26 May 2015 14:11:42 -0400 In-Reply-To: <201505261657.t4QGvJYW019538@fido.openend.se> References: <551c8229-f426-45f0-a0ee-fdad1b161f59@googlegroups.com> <201505261657.t4QGvJYW019538@fido.openend.se> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432663908 news.xs4all.nl 2870 [2001:888:2000:d::a6]:59024 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91259 On Tue, May 26, 2015, at 12:57, Laura Creighton wrote: > Guido did. :) > http://neopythonic.blogspot.se/2008/10/why-explicit-self-has-to-stay.html It's worth noting that the "dynamically modify a class" argument (and to some extent the decorator argument) misses Javascript's solution - _any_ function may refer to "this" (which is not in the argument list), which will be the global scope object (the browser window for browser-hosted javascript - presumably the current module for a hypothetical equivalent python feature, though it might be more prudent to simply make it None.) if the function is called without an object reference. Of course, Javascript also lacks bound methods, which makes it much more likely to happen by accident. I can't really think of anything that you can do with decorators, either, in the current model, that you _couldn't_ do in a JS-alike function call model... but I doubt it would be possible to implement backwards-compatibly. In principle, if you added a class keyword (hey, technically, isn't there one already?) you wouldn't need decorators at all for the staticmethod/classmethod/instance method case.