Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'parameter': 0.05; 'constructor': 0.07; 'subject:object': 0.07; 'foo': 0.09; '__init__': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'wrote:': 0.16; 'instance': 0.18; 'header:In-Reply- To:1': 0.22; 'pm,': 0.26; 'pass': 0.28; 'message-id:@gmail.com': 0.33; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.33; 'reference': 0.37; 'but': 0.37; 'received:org': 0.37; 'could': 0.37; 'received:192': 0.38; 'why': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; '12:44': 0.84 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Mon, 23 Jan 2012 13:10:44 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.16 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Using an object inside a class References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 5 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1327349453 news.xs4all.nl 6885 [2001:888:2000:d::a6]:35792 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19281 On 01/23/2012 12:44 PM, Jonno wrote: > Any ideas why I can reference foo inside the method but not in __init__? No idea, but could you pass foo as a constructor parameter to __init__ and store it as an instance variable?