Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:error': 0.03; 'attribute': 0.07; '[0]': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '[1].': 0.16; 'i.e': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.18; 'wed,': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'fine': 0.24; 'defined': 0.27; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'work.': 0.31; '"",': 0.31; 'file': 0.32; 'class': 0.32; '(most': 0.33; 'but': 0.35; 'should': 0.36; 'error.': 0.37; 'list': 0.37; 'list.': 0.37; 'nov': 0.38; 'others.': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'recent': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; "you're": 0.61; 'first': 0.61; 'pick': 0.64; 'different': 0.65; 'dont': 0.67; 'received:myvzw.com': 0.84; 'top.': 0.84; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: error Date: Wed, 27 Nov 2013 21:30:20 -0500 References: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 151.sub-70-208-162.myvzw.com In-Reply-To: User-Agent: Groundhog Newsreader for Android 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1385605784 news.xs4all.nl 15945 [2001:888:2000:d::a6]:39876 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60660 On Wed, 27 Nov 2013 16:37:37 -0800 (PST), speen saba wrote: > p = [1,2] > And below is the error. Evrything works fine untill class polar point, but when I try to pick point (instance) p in the list i.e x,y (1,2,3,1). It does not work. I mean p.x gets the error where it should give me the value of x. And i know this error will go all the way down to def__cmp if i dont fic it from top. > >>> p.x > Traceback (most recent call last): > File "", line 1, in > p.x > AttributeError: 'list' object has no attribute 'x' You have 4 different implementations, but you're mixing the first with the others. Since p is a list, you need to use list semantics, p [0] and p [1]. The .x attribute is not defined on a list. -- DaveA