Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'subject:not': 0.03; 'parameters': 0.04; 'classes,': 0.05; 'forgive': 0.05; 'assignment': 0.07; 'class,': 0.07; 'subject:code': 0.07; 'suppose': 0.07; 'assigning': 0.09; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'subject:skip:u 10': 0.16; 'wrote:': 0.18; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'received:emailsrvr.com': 0.24; 'question': 0.24; 'class.': 0.26; 'received:(smtp server)': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'code': 0.31; 'gary': 0.31; 'class': 0.32; 'implemented': 0.33; 'sense': 0.34; 'created': 0.35; 'but': 0.35; 'there': 0.35; 'instances': 0.36; 'object,': 0.36; 'thanks': 0.36; 'similar': 0.36; 'error.': 0.37; 'whatever': 0.38; 'to:addr :python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'first': 0.61; 'skip:a 40': 0.72; 'them)': 0.84; 'choice.': 0.93 X-Virus-Scanned: OK Date: Thu, 20 Feb 2014 01:04:50 -0800 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Cannot figure out line of code, also not understanding error 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392887498 news.xs4all.nl 2921 [2001:888:2000:d::a6]:36817 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66739 On 02/20/2014 12:26 AM, ApathyBear wrote: > Thanks for pointing out the missing parenthesis, it makes sense now why there was an error. > > I suppose my question now is (and forgive my ignorance about classes, this is my first time learning them) why is it calling Athlete with some arguments? In order to make a class object, don't you need to create an instance by assigning a class to something? > > like: > x = Athlete(temp1.pop(0),temp1.pop(0),temp1) > > can a similar line look like this?: > temp1.pop(0) = Athlete(temp1.pop(0),temp1) First some notation: You are not creating a class, but rather in instance of a class. The code class Athlete: ... created the class, and now you are ready to create (many?) instances of that class. A call like Athlete(...) will create an instance of that class with whatever parameters you supply. What you do with that instance after it is created is your choice. Assignment is one possibility, but many other operation are also possible: x = Athlete(...) print( Athlete(...) ) Athlete(...)+Athlete(...) # If addition made any sense and was implemented in the class return Athlete(...) ... Gary Herron