Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.054 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'python': 0.08; 'wrong,': 0.09; 'am,': 0.12; 'def': 0.15; "subject:' ": 0.15; '(is': 0.16; 'val': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.16; 'wed,': 0.17; 'cheers,': 0.18; 'to:2**1': 0.20; 'cc:2**0': 0.22; 'header :In-Reply-To:1': 0.22; 'dictionary': 0.23; 'mask': 0.23; 'though.': 0.23; 'aug': 0.24; 'subject:need': 0.28; 'bit': 0.28; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.30; 'confused': 0.30; 'subject:?': 0.31; 'chris': 0.32; 'there': 0.33; 'received:209.85.161': 0.35; 'url:python': 0.36; 'some': 0.38; 'received:google.com': 0.38; 'url:org': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'url:docs': 0.39; "it's": 0.40; 'hope': 0.61; 'double': 0.61; 'below': 0.62; '31,': 0.64; 'self.value': 0.84; 'sender:addr:chris': 0.84; 'subject:always': 0.84; 'subject:class': 0.84; 'subject:self': 0.84; 'terminology': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=w+2DmtL3tnaQSS1/Jkq1CeiUIqqukGQ8vPcOqHhOtgU=; b=RklzecRByW6UA+mFeA85bS7D7ExZY16z5XXEKhRLpck7S1dI79cqVCz+rnPsMiJVxA 8aHYQ3c5M8Ah8aCe7RfGhEFTUyFKfdYPLUa2V6Qw47nrC4wutr4Q4g7ysvL/zvzQShjK pX2QnwqzgFZVFCsuV1xcxI1XxbBVbtHzyytX8= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: <0604E20B5F6F2F4784C9C8C71C5DD4DD2F163CD332@EMARC112VS01.exchad.jpmchase.net> References: <0dc26f12-2541-4d41-8678-4fa53f347acf@g9g2000yqb.googlegroups.com> <0604E20B5F6F2F4784C9C8C71C5DD4DD2F163CD332@EMARC112VS01.exchad.jpmchase.net> Date: Wed, 31 Aug 2011 11:31:21 -0700 X-Google-Sender-Auth: JG8O3bVQKUoLk5l5t_sr6hm2Ojs Subject: Re: Why do class methods always need 'self' as the first parameter? From: Chris Rebert To: "Prasad, Ramit" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1314815483 news.xs4all.nl 2525 [2001:888:2000:d::a6]:57784 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12515 On Wed, Aug 31, 2011 at 10:12 AM, Prasad, Ramit wrote: >>def double(obj): return 2*obj.value >> >>class C: >> =C2=A0 =C2=A0 def __init__(self, val): >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.value =3D val >> >>c =3D C(3) >>C.double =3D double >>c.doub =3D double >># not c.double as that would mask access to C.double in c.double() below >>print(double(c), C.double(c), c.double(), c.doub(c)) > > Sorry if I get some of the following terminology wrong, I get a bit confu= sed on Python terms. I hope the following is still coherent. (Is there a di= ctionary of Python terminology?) The documentation has a glossary: http://docs.python.org/glossary.html It's not entirely comprehensive though. Cheers, Chris