Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.091 X-Spam-Evidence: '*H*': 0.82; '*S*': 0.00; 'def': 0.12; 'a()': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:loss': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'print': 0.22; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'class': 0.32; '"the': 0.34; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'name': 0.63; 'mar': 0.68; '26,': 0.68; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=MTr1Z+NgAXHCC/hG3fF3bdaw2tXohLze1l4bwjf/RhU=; b=g3OomNj9uZ/WCA/Vxx3pUqrk/jIbZ728WDovjNpuG+FfpE6dlDAp081RjUSXNDa6Lf qdczsh8SuSufW/4e8sqbCqGwC8GvN+c+IMItyf4DUrhU0kYPYUISQ3CEoJh9J54hMu9D h75tBjckM7aYzizWVhfU4eJ6hjPKQXqgNRndTaFYZuPZyfw9a3hAJ5rw1sroDCMRXETZ 4E7INhZA+0JMFpg06HXZK9HK4AZSBMosfeF5RZ561Ygs/r6ZSlUWa8z+yiKLWdj3aEcy p2I7+6op3K78XIZWlS5EVjmUar/Bf1M2Vdnp4YQ/gy6a0vYKUBeAAYUblu9kRDTvL6kb 76sA== MIME-Version: 1.0 X-Received: by 10.58.56.161 with SMTP id b1mr18805128veq.42.1364279344999; Mon, 25 Mar 2013 23:29:04 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 Mar 2013 17:29:04 +1100 Subject: Re: At a loss on python scoping. From: Chris Angelico To: python-list@python.org 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364279348 news.xs4all.nl 6880 [2001:888:2000:d::a6]:40335 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41858 On Tue, Mar 26, 2013 at 5:17 PM, Shiyao Ma wrote: > class A: > r = 5 > def func(self, s): > self.s = s > a = A() > print(a.r) # this should print 5, but where does py store the name of r What do you mean by "the name of r"? ChrisA