Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19281

Re: Using an object inside a class

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 <torriem@gmail.com>
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 <torriem@gmail.com>
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 <CAGz2ECYwdnB2ZoTo-DXHhO1_MzdjWeYB+nxeNJ+xivPa8N-tVA@mail.gmail.com>
In-Reply-To <CAGz2ECYwdnB2ZoTo-DXHhO1_MzdjWeYB+nxeNJ+xivPa8N-tVA@mail.gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4977.1327349453.27778.python-list@python.org> (permalink)
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

Show key headers only | View raw


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?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Using an object inside a class Michael Torrie <torriem@gmail.com> - 2012-01-23 13:10 -0700

csiph-web