Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'languages,': 0.04; 'c++,': 0.07; 'correct.': 0.07; 'odd': 0.07; 'oop': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '"current': 0.16; '*any*': 0.16; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'instance:': 0.16; 'shortcut': 0.16; 'subject:class': 0.16; 'syntactic': 0.16; 'all.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'bit': 0.19; 'unlike': 0.19; 'rules': 0.22; 'cc:addr:python.org': 0.22; 'java': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'languages': 0.32; 'style': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'nov': 0.38; 'pm,': 0.38; 'most': 0.60; 'believe': 0.68; 'family': 0.73; 'special': 0.74; 'subject:have': 0.80; 'believe,': 0.84; 'to:none': 0.92; 'insane': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=5Pi3C/qzlzndqAH6KOSM+dHfK5sFmzgslcUO5Gw2gps=; b=ChxLcz0JP65UBtpFDaM0+g3gf/M/w8taUd7FXSjy/jW4vSYOQXUsXW9m/Oh+E6ptKd li6x2VqB56Zs7pjYfPWaiFgoNLiu5nR/fuhsQvgWluDrnWnczcuRAxCh+1gO2YIPKcGl xFTgkyn0ZE0SjxOzP3c00lZExnsFnQg0ouvx58keHXCAuJKjjEZto6VJGroUDmso/Z+t PUvzYoRkiFAidOz59qTPHIVGD5UlYx0euNSa/ug48MLX6LIPm1sCtfdCJ3N8vSlRwy7f WlZhJyXk2wHjv8T3G4+cvlEM6qvl9Use/P3x0pXI2WDQxNOyTERuZ4n/ex3jmX85kLYl SgIg== MIME-Version: 1.0 X-Received: by 10.107.134.39 with SMTP id i39mr15898484iod.53.1416805892984; Sun, 23 Nov 2014 21:11:32 -0800 (PST) In-Reply-To: <5472b24c$0$12979$c3e8da3$5496439d@news.astraweb.com> References: <2qn27adjq412n9nff9kv5jh25d1ekkbncp@4ax.com> <8d047ahkrb4uh4qpq1uk74tel4nfc4s8uv@4ax.com> <66b13454-3503-4111-bf8e-58ce79ef00aa@googlegroups.com> <5472b24c$0$12979$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 24 Nov 2014 16:11:32 +1100 Subject: Re: I have no class From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416805895 news.xs4all.nl 2886 [2001:888:2000:d::a6]:36912 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81429 On Mon, Nov 24, 2014 at 3:21 PM, Steven D'Aprano wrote: > On Sun, 23 Nov 2014 09:02:57 -0800, Rustom Mody wrote: > >> Python is a bit odd in the OO-world in that it prioritizes "Explicit is >> better than implicit" over convenience. >> >> Notice that you use self.throw where in most other OOP languages you >> would use just throw. > > I don't think that is correct. I think that most OOP languages are like > Python, and use a special variable to reference the current instance: > > In some of these languages, the use of "this/self/me" is optional, but > I'm not aware of *any* OOP language where there is no named reference to > the current object at all. I believe his point is that Python, unlike every other language he can think of, requires "self.x" instead of just "x". Every language needs a way to say "current object", but not every language needs you to say that for every member reference. C++, Pike, and Java let you short-hand that. (They're all deriving from the same syntactic style anyway.) JavaScript doesn't, I believe, although its variable scoping rules are some of the most insane I've ever met, so there might be a way to shortcut it. If your experience of OO is mainly from C++/Java family languages, then yes, Python will seem odd. ChrisA