proposal, change self. to .

Discussion in 'Python' started by Heiko Wundram, Aug 3, 2008.

  1. Am 03.08.2008, 12:51 Uhr, schrieb Equand <>:
    > how about changing the precious self. to .
    > imagine
    >
    > self.update()
    >
    > .update()
    >
    > simple right?


    What about:

    class x:

    def x(self,ob):
    ob.doSomethingWith(self)

    ? Not so simple anymore, isn't it? If you're not trolling, there's
    hundreds of reasons why the explicit self is as it is, and it's not going
    to go away, just as a thread that produced immense amounts of response
    demonstrated around a week ago. Read that, and rethink.

    --- Heiko.
    Heiko Wundram, Aug 3, 2008
    #1
    1. Advertising

  2. Heiko Wundram

    Equand Guest

    how about changing the precious self. to .
    imagine

    self.update()

    ..update()

    simple right?
    Equand, Aug 3, 2008
    #2
    1. Advertising

  3. Heiko Wundram

    Guest

    Heiko Wundram:
    > > how about changing the precious self. to .
    > > imagine
    > > self.update()
    > > .update()
    > > simple right?


    I suggest you to start using Ruby instead.

    Bye,
    bearophile
    , Aug 5, 2008
    #3
  4. Heiko Wundram

    Russ P. Guest

    On Aug 3, 4:10 am, "Heiko Wundram" <> wrote:
    > Am 03.08.2008, 12:51 Uhr, schrieb Equand <>:
    >
    > > how about changing the precious self. to .
    > > imagine

    >
    > > self.update()

    >
    > > .update()

    >
    > > simple right?

    >
    > What about:
    >
    > class x:
    >
    > def x(self,ob):
    > ob.doSomethingWith(self)
    >
    > ? Not so simple anymore, isn't it? If you're not trolling, there's


    This is not a problem at all. If the OP got what he wanted, "self"
    could still be available just as it is now to do what you suggested
    above. That would not need to change.

    > hundreds of reasons why the explicit self is as it is, and it's not going
    > to go away, just as a thread that produced immense amounts of response
    > demonstrated around a week ago. Read that, and rethink.
    >
    > --- Heiko.
    Russ P., Aug 5, 2008
    #4
  5. Heiko Wundram

    Russ P. Guest

    On Aug 3, 5:44 am, Nick Dumas <> wrote:
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > It's also worth noting that you can use a different name for the object
    > that represents your class. If you did def __init__(foo):pass, then you
    > would be able to access the class's objects with foo.objectname. Using
    > self is simply the recommended standard.


    That is not a problem either. What the OP wanted could apply
    regardless of what the first argument is named. In fact, an advantage
    of what the OP requested would be that a person reading the code need
    not be concerned with the name of the first argument.
    Russ P., Aug 5, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ralf W. Grosse-Kunstleve
    Replies:
    16
    Views:
    559
    Lonnie Princehouse
    Jul 11, 2005
  2. Ralf W. Grosse-Kunstleve
    Replies:
    18
    Views:
    578
    Bengt Richter
    Jul 11, 2005
  3. Ralf W. Grosse-Kunstleve
    Replies:
    2
    Views:
    387
    Dan Sommers
    Jul 12, 2005
  4. falcon
    Replies:
    0
    Views:
    357
    falcon
    Jul 31, 2005
  5. Bart Kastermans
    Replies:
    6
    Views:
    383
    Bart Kastermans
    Jul 13, 2008
Loading...

Share This Page