Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25834

Re: default repr?

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 <jeanpierreda@gmail.com>
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 <CAPTjJmr=QTWyJT5s71bU8ej=bNgibOdu2JApbFkKCm8TJzWi5w@mail.gmail.com>
References <CAGGBd_oD9tT6Ej0NdsPF7-VRda1k_GQmUQAuutg-eO+XbdYD3Q@mail.gmail.com> <mailman.2444.1342997643.4697.python-list@python.org> <500c99d5$0$29978$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmr=QTWyJT5s71bU8ej=bNgibOdu2JApbFkKCm8TJzWi5w@mail.gmail.com>
From Devin Jeanpierre <jeanpierreda@gmail.com>
Date Sun, 22 Jul 2012 20:44:56 -0400
Subject Re: default repr?
To Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2448.1343004339.4697.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Sun, Jul 22, 2012 at 8:29 PM, Chris Angelico <rosuav@gmail.com> wrote:
> On Mon, Jul 23, 2012 at 10:24 AM, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: default repr? Chris Angelico <rosuav@gmail.com> - 2012-07-23 08:54 +1000
  Re: default repr? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-23 00:24 +0000
    Re: default repr? Chris Angelico <rosuav@gmail.com> - 2012-07-23 10:29 +1000
      Re: default repr? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-23 01:40 +0000
    Re: default repr? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-07-22 20:44 -0400

csiph-web