Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed1.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'tutorial': 0.03; 'explicitly': 0.05; '(aka': 0.09; 'arrays': 0.09; "people's": 0.09; 'subject:question': 0.10; 'advice,': 0.16; 'attribute?': 0.16; 'attributes.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'fyi,': 0.16; 'numpy': 0.16; 'self.x,': 0.16; 'self.y': 0.16; 'subject:class': 0.16; 'x,y,z': 0.16; 'wrote:': 0.18; 'thu,': 0.19; "i've": 0.25; 'define': 0.26; 'holds': 0.26; 'posts': 0.26; 'values': 0.27; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '13,': 0.31; 'operations.': 0.31; 'class': 0.32; 'covered': 0.32; 'received:209.85': 0.35; 'classes': 0.35; 'received:209.85.220': 0.35; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; "he's": 0.36; 'subject:regarding': 0.36; "didn't": 0.36; 'list': 0.37; 'received:209': 0.37; 'area': 0.37; 'represent': 0.38; 'sometimes': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'space': 0.40; 'days': 0.60; 'ago.': 0.61; 'talking': 0.65; 'series': 0.66; 'between': 0.67; 'frequently': 0.68; 'differences': 0.93; 'rick': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=zRS/f1nTGK+IXU1WTUa3zAZ6jMw+zr8s31JgdoAdxS8=; b=T7AXlrOOTz2W0BO+uVQvvVT7Bdu8pkAVinUzACjZt7i0g/DRbhn2f+HSqw5gCYSlBP LSHO1O1+vuznm1yvct/xwh1epvwaHziXf5SEp7zDc/rcs4C18YYAOWxxdxzcP+dhzHf2 uNQfPFoRqS/Fs+jk75n3nBvsFHKkhs1+Eu7lGtCfeZ502L7XYZE16MFusficptsXFCkb NQQEKeNh53U8XMU0e9qD4twc2ky2ZiPabIBkPmC5PFwRs5OcpvsUaEtRsuGqEs81D9fh OKh+yEN32g4CkPLRFerW3N7ZdMLlooaOuCsBDHqZDblYx9z0GDIWtXosVk4xPzAaDCuY qmlQ== MIME-Version: 1.0 X-Received: by 10.52.121.99 with SMTP id lj3mr334987vdb.52.1371132468513; Thu, 13 Jun 2013 07:07:48 -0700 (PDT) In-Reply-To: References: <1f11f483-e152-4fe3-8b11-e83bacf2ed63@googlegroups.com> Date: Fri, 14 Jun 2013 00:07:48 +1000 Subject: Re: Newbie: question regarding references and class relationships 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371132471 news.xs4all.nl 15973 [2001:888:2000:d::a6]:38726 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47966 On Thu, Jun 13, 2013 at 10:06 PM, Rui Maciel wrote: > Rick Johnson wrote: >> Firstly. Why would you define a Point object that holds it's x,y,z values >> in a list attribute? Why not store them as self.x, self.y and self.z? > > > The position in space is represented as a vector, which is then used in a > series of operations. > > Currently I'm using numpy arrays to represent vectors. > > >> Secondly, why would store the position of the Point as a class attribute? > > > I've answered this 3 days ago. I'm still learning Python, and python.org's > tutorial on classes didn't explicitly covered the differences between class > and instance attributes. Just FYI, Rick Johnson (aka Ranting Rick) is a known troll. Don't let him goad you :) Follow other people's advice, and take Rick's posts with a grain of salt. Sometimes he has a good point to make (more often when he's talking about tkinter, which is his area of expertise), but frequently he spouts rubbish. ChrisA