Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'arguments': 0.07; 'correct.': 0.07; 'python': 0.09; '22,': 0.09; 'cc:addr:python- list': 0.10; 'def': 0.10; 'hmm.': 0.16; 'subject:default': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'typing': 0.17; '>>>': 0.18; 'cc:2**0': 0.23; 'class.': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'am,': 0.27; 'then.': 0.27; 'message- id:@mail.gmail.com': 0.27; 'all.': 0.28; 'chris': 0.28; "d'aprano": 0.29; 'steven': 0.29; 'class': 0.29; 'code': 0.31; 'received:209.85.160.46': 0.32; 'received:google.com': 0.34; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'stand': 0.61; 'jul': 0.65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=uZeAJR9Ppz6hmn3/tymLCrs2B4qLAvWKdBZtFx4LIJA=; b=cEI5AR3peISOrR629MpG47AyxgZ1iQH9owZKdFfWt2HWHu2kZi0oPNSLuBhryBxEyI GHwL2xDsIQVPgY+WeE1L9tAJPsF5/PRqasOrax6teHuVSdEormmNUZ02OiYH3djtFw3N ORMOMnv7Hw3zaIjCsz+2X+BZiLYNLEGSt3BP447pM9onwvhnFnGXlzFjLqBAbBIYm78M TV55fyKPbuAs+UQu5EJl+M2Z18nHkzOLTNAG5JHw7b4By8rbt0vDELpEEZghuIjaF2dD URJ0eCAbjGtnuUqMzA/WKVHFCcFHPMZ7j8XfoNkjuF2E29dvGyCYEx2MzTp8Mns5eJdi YNVw== MIME-Version: 1.0 In-Reply-To: References: <500c99d5$0$29978$c3e8da3$5496439d@news.astraweb.com> From: Devin Jeanpierre Date: Sun, 22 Jul 2012 20:44:56 -0400 Subject: Re: default repr? To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org 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: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343004339 news.xs4all.nl 6876 [2001:888:2000:d::a6]:34822 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25834 On Sun, Jul 22, 2012 at 8:29 PM, Chris Angelico wrote: > On Mon, Jul 23, 2012 at 10:24 AM, Steven D'Aprano > wrote: >> Not quite: they have to be an instance of that class. ----8<---- > Hmm. I would have thought that methods were like all other functions: > they take their arguments and do code with them. Duck typing and all. > I stand corrected, then. On Python 3 you are correct. >>> class A: ... def print(self): ... print(self) ... >>> A.print(2) 2 -- Devin