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


Groups > comp.lang.python > #106617

Re: Promoting Python

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Promoting Python
Date Thu, 7 Apr 2016 00:56:18 -0600
Lines 45
Message-ID <mailman.3.1460012220.2253.python-list@python.org> (permalink)
References <DUB110-DS131649FA6F6AA56BBDD63E989E0@phx.gbl> <ne2qd3$8rg$1@dont-email.me> <87h9ffgdtr.fsf@elektro.pacujo.net> <CAGgTfkPkgKnugcnRaY1PgCuJfUsKv5Ef__rbhTM_oNpK+HTAfQ@mail.gmail.com> <mailman.133.1459949616.32530.python-list@python.org> <87zit6lt8q.fsf@elektro.pacujo.net> <CALwzidnMzeh_qKXBCikrb8T7Mp39+7ERx3QbEf1c1_+NSSaxwA@mail.gmail.com> <mailman.29.1459968672.1197.python-list@python.org> <87wpoak0f7.fsf@elektro.pacujo.net> <CALwzidnWyAxZ-pesgbQ87hmEWEWj27CA8ZJCAruk3L1=H_QRVw@mail.gmail.com> <mailman.35.1459971706.1197.python-list@python.org> <87mvp6jyoi.fsf@elektro.pacujo.net> <CALwzidmyUEenonFLmUs0jGBCbwatBVhQJiVtsCEYTCSX0Tz1aw@mail.gmail.com> <mailman.39.1459974039.1197.python-list@python.org> <87egaijwuy.fsf@elektro.pacujo.net> <CALwzid=5eNxPOFm1zDe_wXSbW_HM1trO-1YxrpA7qrTQ0p9AiA@mail.gmail.com> <mailman.43.1459978690.1197.python-list@python.org> <87wpoaiedl.fsf@elektro.pacujo.net> <57059E6D.8070105@roce.be> <mailman.56.1459992022.1197.python-list@python.org> <87r3eihqvx.fsf@elektro.pacujo.net> <CALwzidmk0-v5b1-DQ-D2bwebzrHng3bYWBBUTobXrNM6-oOOsw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de njQZPj4AzrMmFG3gmRcqLgG7rRwKeTz9i+o76lWI6SNg==
Return-Path <ian.g.kelly@gmail.com>
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; 'subject:Python': 0.05; 'attributes': 0.07; 'def': 0.13; 'thu,': 0.15; "'ok')": 0.16; '12:30': 0.16; '2016': 0.16; 'button(self,': 0.16; 'over:': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'say)': 0.16; 'wrote:': 0.16; 'attribute': 0.18; 'example.': 0.18; 'latter': 0.22; 'title,': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'example': 0.26; 'message-id:@mail.gmail.com': 0.27; 'object,': 0.27; 'skip:e 30': 0.27; 'yield': 0.27; 'function': 0.28; 'regular': 0.29; 'dialog': 0.29; 'oop': 0.29; 'received:209.85.213.174': 0.29; 'supposed': 0.31; 'skip:s 30': 0.31; 'skip:_ 10': 0.32; 'class': 0.33; 'url:python': 0.33; '(for': 0.34; 'received:google.com': 0.35; 'so,': 0.35; 'instance': 0.35; 'set.': 0.35; 'should': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:209.85.213': 0.37; 'difference': 0.38; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'url:3': 0.60; 'different': 0.63; 'you.': 0.64; 'between': 0.65; 'or:': 0.84; 'to:name:python': 0.84; 'url:datamodel': 0.84; 'url:reference': 0.91
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; bh=JSXj6eNdS6J+AJt1kcswATU5OusM7SniY6762swKyGw=; b=K/dV4sNcvT29uqH3OCadn4i3oypJxoUXp0oFjNjBam/MFMCXFGNVKQM5KntRs5S40e wU4GTgUWIUeSjlasY2QQ08JH6uvhbHVvtQdXCrATFetHUyLhjws6NmUuc51zJSyU4ona a18RnFWxsoYry9CKnWGTa6vtw5gmcL6y8cYLrj0uFzobYRih2fnvJeVg+rSWBY5lo7P9 gsCmvlY/hOJBTEyuUE4SF4KOF1W3wsvymJpjHOyUj7YtlpsVR7IKstRlDn2xvi7u0eYz cLlP8ip4dazTZFjou+b/hMKMuo4LiS2Dlv84rt7ZHU3T66bjGfMZQOIOyrz4yE4TLakZ y5Cw==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=JSXj6eNdS6J+AJt1kcswATU5OusM7SniY6762swKyGw=; b=GsLMUSVxl8bDQFT19p5KMYiA3+9WyKPBJ8ieZRvVPgjAvbJQq0S6uKfkWx27lrlCaV PgkJ4CobirSs3kW29K8bmgPOSwjF4IAv00D0CXrgpaiAEAtQ0NRQf/GDj6vDUtj9cn9f W0pLfuI5amThxfLMYyNlExcuSmX7Jjo9XR5FRsCn63vfyR8J2nBY65x0CM2MEWCXN/D5 R5vh9SQbdm4ANCwAzILc5s+kTQXGJrJ2M0prqL08KESQ5fvcUCURrMSSnhAB6xJQ1lw6 n8LTfaR6zxWoYJP/FEmvJo6SJZDELU9frb+At7Lw8vZ08eTWsA2+cqcJGVI6FcNP//tU +XdQ==
X-Gm-Message-State AD7BkJLydbul+QIz34yNi2DAzZt2EgW2H6fujCK1cJXodIvb+lJJjqtp1qD46aRR4vBj9JpxCO1yQImj26CTxw==
X-Received by 10.50.72.107 with SMTP id c11mr1777306igv.85.1460012218124; Wed, 06 Apr 2016 23:56:58 -0700 (PDT)
In-Reply-To <87r3eihqvx.fsf@elektro.pacujo.net>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CALwzidmk0-v5b1-DQ-D2bwebzrHng3bYWBBUTobXrNM6-oOOsw@mail.gmail.com>
X-Mailman-Original-References <DUB110-DS131649FA6F6AA56BBDD63E989E0@phx.gbl> <ne2qd3$8rg$1@dont-email.me> <87h9ffgdtr.fsf@elektro.pacujo.net> <CAGgTfkPkgKnugcnRaY1PgCuJfUsKv5Ef__rbhTM_oNpK+HTAfQ@mail.gmail.com> <mailman.133.1459949616.32530.python-list@python.org> <87zit6lt8q.fsf@elektro.pacujo.net> <CALwzidnMzeh_qKXBCikrb8T7Mp39+7ERx3QbEf1c1_+NSSaxwA@mail.gmail.com> <mailman.29.1459968672.1197.python-list@python.org> <87wpoak0f7.fsf@elektro.pacujo.net> <CALwzidnWyAxZ-pesgbQ87hmEWEWj27CA8ZJCAruk3L1=H_QRVw@mail.gmail.com> <mailman.35.1459971706.1197.python-list@python.org> <87mvp6jyoi.fsf@elektro.pacujo.net> <CALwzidmyUEenonFLmUs0jGBCbwatBVhQJiVtsCEYTCSX0Tz1aw@mail.gmail.com> <mailman.39.1459974039.1197.python-list@python.org> <87egaijwuy.fsf@elektro.pacujo.net> <CALwzid=5eNxPOFm1zDe_wXSbW_HM1trO-1YxrpA7qrTQ0p9AiA@mail.gmail.com> <mailman.43.1459978690.1197.python-list@python.org> <87wpoaiedl.fsf@elektro.pacujo.net> <57059E6D.8070105@roce.be> <mailman.56.1459992022.1197.python-list@python.org> <87r3eihqvx.fsf@elektro.pacujo.net>
Xref csiph.com comp.lang.python:106617

Show key headers only | View raw


On Thu, Apr 7, 2016 at 12:30 AM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Or:
>
>    When a class attribute reference (for class C, say) would yield a
>    class method object, it is transformed into an instance method object
>    whose __self__ attributes is C.
>    <URL: https://docs.python.org/3/reference/datamodel.html?highlight=__g
>    etattr__#the-standard-type-hierarchy>
>
> So the only difference between a regular function and an instance method
> object is the fact that the latter has a __self__ attribute set.
>
> Although even that small difference can be paved over:
>
>     def g():
>         print("g")
>     g.__self__ = a
>     a.f = g

What is this example supposed to accomplish?  Functions don't merely
not have a __self__ attribute set. The __self__ attribute has no
meaning on a function.

Let's take a different example.


class Dialog(Window):

    def __init__(self, parent, title, ok_callback):
        super().__init__(parent, title)
        self._ok_callback = ok_callback
        self._ok_button = Button(self, 'Ok')
        self._ok_button.bind(self._ok_callback)

def f(event):
    print("Hello world")

dialog = Dialog(None, "Example", f)
dialog.show()


Are you suggesting that dialog._ok_callback should be considered a
method of Dialog, despite the fact that the implementation of Dialog
and the implementation of f are entirely unrelated? If so, then I
think that most OOP practitioners would disagree with you.

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


Thread

Promoting Python "Gordon( Hotmail )" <sionet3344@hotmail.co.uk> - 2016-04-05 06:48 +0100
  Re: Promoting Python Rustom Mody <rustompmody@gmail.com> - 2016-04-05 00:31 -0700
    Re: Promoting Python Joel Goldstick <joel.goldstick@gmail.com> - 2016-04-05 08:06 -0400
      Re: Promoting Python alister <alister.ware@ntlworld.com> - 2016-04-05 18:02 +0000
        Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-05 19:47 +0100
          Re: Promoting Python alister <alister.ware@ntlworld.com> - 2016-04-05 19:38 +0000
    Re: Promoting Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-05 08:13 -0400
      Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-05 15:31 +0300
  Re: Promoting Python Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-04-06 20:52 +1200
    Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 12:12 +0300
  Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 12:06 +0100
    Re: Promoting Python Ned Batchelder <ned@nedbatchelder.com> - 2016-04-06 04:38 -0700
      Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 14:21 +0100
    Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 14:46 +0300
      Re: Promoting Python Michael Selik <michael.selik@gmail.com> - 2016-04-06 13:33 +0000
        Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 17:14 +0300
          Re: Promoting Python Chris Angelico <rosuav@gmail.com> - 2016-04-07 00:20 +1000
            Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 21:23 +0300
              Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 21:50 +0300
              Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 22:30 +0300
          Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 22:22 +0300
            Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 22:59 +0300
              Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 23:39 +0300
                Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-07 01:03 +0300
                Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-07 09:30 +0300
                Re: Promoting Python Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-07 00:56 -0600
                Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-07 10:19 +0300
                Re: Promoting Python Steven D'Aprano <steve@pearwood.info> - 2016-04-08 16:09 +1000
          Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 23:05 +0300
      Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 14:54 +0100
        Re: Promoting Python Marko Rauhamaa <marko@pacujo.net> - 2016-04-06 17:08 +0300
          Re: Promoting Python Larry Martell <larry.martell@gmail.com> - 2016-04-06 10:36 -0400
        Re: Promoting Python Chris Angelico <rosuav@gmail.com> - 2016-04-07 00:14 +1000
        Re: Promoting Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-04-06 15:20 +0100
          Re: Promoting Python Ned Batchelder <ned@nedbatchelder.com> - 2016-04-06 07:34 -0700
            Re: Promoting Python Ned Batchelder <ned@nedbatchelder.com> - 2016-04-06 10:55 -0700
              Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 23:24 +0100
          Re: Promoting Python BartC <bc@freeuk.com> - 2016-04-06 18:04 +0100
    Re: Promoting Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-06 08:04 -0400
    Re: Promoting Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-04-06 13:39 +0100
    Re: Promoting Python Steven D'Aprano <steve@pearwood.info> - 2016-04-07 03:40 +1000

csiph-web