Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.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.044 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.01; 'scripts': 0.03; "subject:' ": 0.07; 'variables': 0.07; 'subject:Help': 0.11; 'python': 0.11; 'def': 0.12; 'defined.': 0.16; 'language': 0.16; 'all,': 0.19; 'bit': 0.19; 'written': 0.21; 'this?': 0.23; 'header:User- Agent:1': 0.23; "i've": 0.25; 'mention': 0.26; 'header:In-Reply- To:1': 0.27; "i'm": 0.30; 'code': 0.31; 'extending': 0.31; 'anyone': 0.31; 'could': 0.34; 'subject:with': 0.35; "can't": 0.35; 'anywhere': 0.35; 'but': 0.35; 'there': 0.35; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'yes': 0.68; 'pardon': 0.84; 'received:195.238': 0.84; 'received:195.238.6': 0.84; 'received:195.238.6.173': 0.84; 'received:belgacom.be': 0.84; 'received:isp.belgacom.be': 0.84; 'received:mailrelay007.isp.belgacom.be': 0.84; 'subject:self': 0.84 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtEDAMpG3FFbtr6f/2dsb2JhbAANTYM7gw6+SgQBAwGBL4MYAQEEOEARCyEWDwkDAgECAUUTCAKwMIociAaPDGYWg1wDl1OBKYh3ijs Date: Tue, 09 Jul 2013 19:24:54 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Help with 'self' and 'set_usage' References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373390763 news.xs4all.nl 15944 [2001:888:2000:d::a6]:35581 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50265 Op 09-07-13 19:03, L O'Shea schreef: > Hi all, > I'm interning and have been given the job of extending a program that > has been written by someone else. I've never used Python before so it's > a bit of a struggle but I've got to say I'm loving the language so far. > > In on of the scripts there is > > def set_usage(self,s): > self.usage_str = s > > Could anyone shed some light on this? I can't find mention of this > anywhere in any Python documentation or anywhere else in the code > where usage_str might be defined. Can you just create variables in > that object by writing self.name = "david" self.hobby = "fishing"?? Yes you can. -- Antoon Pardon