Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed5.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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'method,': 0.05; 'argument,': 0.09; 'arguments,': 0.09; 'be:': 0.09; 'subclass': 0.09; 'subject:method': 0.09; 'to:addr:comp.lang.python': 0.09; 'two.': 0.16; 'cc:addr:python-list': 0.16; 'instance': 0.18; 'cc:no real name:2**0': 0.21; "doesn't": 0.22; 'header:In-Reply- To:1': 0.22; 'subject:use': 0.24; 'tried': 0.27; 'cc:addr:gmail.com': 0.28; 'class': 0.29; 'cc:addr:python.org': 0.29; 'error': 0.30; 'subject:?': 0.31; 'actually': 0.31; 'does': 0.32; "isn't": 0.33; 'received:209.85.212': 0.33; 'header:User- Agent:1': 0.33; 'it?': 0.33; 'thank': 0.35; 'be.': 0.35; 'cc:2**1': 0.36; 'passed': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'using': 0.37; 'happens': 0.38; 'received:209.85': 0.38; 'getting': 0.38; 'received:209': 0.39; 'your': 0.61; 'subject:this': 0.74; 'contrast,': 0.84; 'received:209.85.212.56': 0.91; 'received:mail- vw0-f56.google.com': 0.91 Received-SPF: pass (google.com: domain of johnjsal@gmail.com designates 10.236.201.161 as permitted sender) client-ip=10.236.201.161; Authentication-Results: mr.google.com; spf=pass (google.com: domain of johnjsal@gmail.com designates 10.236.201.161 as permitted sender) smtp.mail=johnjsal@gmail.com Newsgroups: comp.lang.python Date: Thu, 1 Mar 2012 23:16:54 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.30.237.113; posting-account=Wdz3OgoAAACumWTKfPjpOEJc3twpMp_1 References: <4136337.363.1330668021961.JavaMail.geo-discussion-forums@ynjd19> User-Agent: G2/1.0 X-Google-Web-Client: true MIME-Version: 1.0 Subject: Re: Is this the proper way to use a class method? From: John Salerno To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org, John Salerno X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1330672617 news.xs4all.nl 6894 [2001:888:2000:d::a6]:55497 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21126 > That's just a coincidence. Your supercall is ought to be: super().move() > In contrast, super().move(self) calls the superclass instance method > `move` with 2 arguments, both `self`, which just happens to work given > your move() method, inside which `cls` isn't actually a class like it > ought to be. Thank you! This is the whole reason I tried using a class method in the fir= st place. I was getting an error that said my move method only takes one ar= gument, but I was passing in two. But if I make the super call as super().move(), how does that work? The mov= e method in the superclass takes an argument, and if I just do super().move= (), isn't it the subclass that's getting passed to it? How does the supercl= ass move method know what 'self' is if it doesn't get passed to it as I did= originally?