def __init__ question in a class definition

Discussion in 'Python' started by Jeffrey Borkent, Feb 7, 2005.

  1. Hi There,

    I have an open source program which i am trying to add to.

    class classname(member,member)

    def __init__(self,list)
    self.__list = list
    self.refresh = 360

    my question is what is the __ (double underscore) represent, if
    anything, in this bliock of assignmeents? I wish to add some more names
    but do not know if i need the __ or not?

    IE: is there any special significance to the __ in this case.

    Cheers






    --
    Jeffrey Borkent
    Systems Specialist
    Information Technology Services
    University of Adelaide
    Level 7, 10 Pultney Street
    Adelaide. 5005
    Ph: 8303 3000



    ---------------------------------
    CRICOS Provider Number 00123M
    -----------------------------------------------------------
    This email message is intended only for the addressee(s)
    and contains information that may be confidential and/or
    copyright. If you are not the intended recipient please
    notify the sender by reply email and immediately delete
    this email. Use, disclosure or reproduction of this email
    by anyone other than the intended recipient(s) is strictly
    prohibited. No representation is made that this email or
    any attachments are free of viruses. Virus scanning is
    recommended and is the responsibility of the recipient.
     
    Jeffrey Borkent, Feb 7, 2005
    #1
    1. Advertising

  2. Jeffrey Borkent

    M.E.Farmer Guest

    >Jeffrey Borkent
    >Systems Specialist
    >Information Technology Services


    With that kind of credentials, and the fact that you claim you are a
    system specialists....
    I don't know you have me worried already.
    I guess for you I just say RTFM.
    If you think that is harsh then don't ask a 2nd grade question yet
    claim/pretend to be some sorta system specialists.
    You tried searching the archives first I am sure.
    Go here http://www.python.org and *read*, come back when you are
    really stuck.
    M.E.Farmer
    P.S. YES the __ matter, they identify special methods ! __init__ is the
    class CONSTRUCTOR.
     
    M.E.Farmer, Feb 7, 2005
    #2
    1. Advertising

  3. Jeffrey Borkent

    Steve Holden Guest

    M.E.Farmer wrote:

    >>Jeffrey Borkent
    >>Systems Specialist
    >>Information Technology Services

    >
    >
    > With that kind of credentials, and the fact that you claim you are a
    > system specialists....
    > I don't know you have me worried already.
    > I guess for you I just say RTFM.
    > If you think that is harsh then don't ask a 2nd grade question yet
    > claim/pretend to be some sorta system specialists.


    Hey, ease up, this is comp.lang.python, remember.

    > You tried searching the archives first I am sure.
    > Go here http://www.python.org and *read*, come back when you are
    > really stuck.
    > M.E.Farmer
    > P.S. YES the __ matter, they identify special methods ! __init__ is the
    > class CONSTRUCTOR.
    >

    Next time, could we try exchanging the body of the message and the PS?
    That way you could have omitted the PS when you got half way through it
    and realised you were just wasting your time and everyone else's ...

    got-out-the-wrong-side-of-bed-ly y'rs - steve
    --
    Meet the Python developers and your c.l.py favorites March 23-25
    Come to PyCon DC 2005 http://www.pycon.org/
    Steve Holden http://www.holdenweb.com/
     
    Steve Holden, Feb 7, 2005
    #3
  4. Jeffrey Borkent

    M.E.Farmer Guest

    Steve Holden wrote:
    > M.E.Farmer wrote:
    >
    > >>Jeffrey Borkent
    > >>Systems Specialist
    > >>Information Technology Services

    > >
    > >
    > > With that kind of credentials, and the fact that you claim you are

    a
    > > system specialists....
    > > I don't know you have me worried already.
    > > I guess for you I just say RTFM.
    > > If you think that is harsh then don't ask a 2nd grade question yet
    > > claim/pretend to be some sorta system specialists.

    >
    > Hey, ease up, this is comp.lang.python, remember.
    >
    > > You tried searching the archives first I am sure.
    > > Go here http://www.python.org and *read*, come back when you are
    > > really stuck.
    > > M.E.Farmer
    > > P.S. YES the __ matter, they identify special methods ! __init__ is

    the
    > > class CONSTRUCTOR.
    > >

    > Next time, could we try exchanging the body of the message and the

    PS?
    > That way you could have omitted the PS when you got half way through

    it
    > and realised you were just wasting your time and everyone else's ...
    >
    > got-out-the-wrong-side-of-bed-ly y'rs - steve
    > --
    > Meet the Python developers and your c.l.py favorites March 23-25
    > Come to PyCon DC 2005 http://www.pycon.org/
    > Steve Holden http://www.holdenwewb.com

    P.S. And in an effort to keep on topic...PYCON!!
    steve,
    I stand by what I said.
    Teach a man to fish feed him for a lifetime.
    Re-read it, memorize it, and keep it near.
    I read comp.lang.py for 3 years before I posted anything, and then i
    posted an ANSWER!
    I don't go around asking dirt simple questions that would be solved
    with a quick read of the docs, usenet archives , Google, books that
    have been written about Python,etc.... He should have been *reading*
    not *posting*.
    I can not understand why you have a problem with me pointing out he
    should read the documentation. Why do you think RTFM exist, for people
    like that, they are a timesink. He can redeem himself if he just goes
    and reads a little and comes back looking like he made some effort.
    This guy has a 6 mile sig that says he ought to know better. Had he
    come with a different sig *maybe* and a question that did not scream
    '''HEY I WANT YOU TO ANSWER EVERYTHING FOR ME BECAUSE I CAN NOT EVEN
    READ THE BASIC DOCUMENTATION ON MY OWN'''.

    > Next time, could we try exchanging the body of the message and the

    PS?
    > That way you could have omitted the PS when you got half way through

    it
    > and realised you were just wasting your time and everyone else's ...


    I tell him where he is wrong first then I answer the question, sounds
    like *YOU* ....Now I have your attention.
    What do you think that post was meant to do? Snap him off at the root?
    Make him cry? Maybe it was to nudge him to read the docs, so he can
    *learn* on his own.
    Next time you could just write my post for me! That way I can only
    waste as much time as you deem acceptable! Now that I think about it,
    if we just answer every question every poster has about any detail of
    Python, then we can all sing along and hold hands, who needs to write
    documentation or even books about Python look at all the time we will
    save...

    > got-out-the-wrong-side-of-bed-ly y'rs - steve

    Which-side is-the wrong-side-ly yr's - M.E.Farmer
     
    M.E.Farmer, Feb 8, 2005
    #4
  5. Jeffrey Borkent

    Steve Holden Guest

    M.E.Farmer wrote:

    > Steve Holden wrote:
    >
    >>M.E.Farmer wrote:
    >>
    >>
    >>>>Jeffrey Borkent
    >>>>Systems Specialist
    >>>>Information Technology Services
    >>>
    >>>
    >>>With that kind of credentials, and the fact that you claim you are

    >
    > a
    >
    >>>system specialists....
    >>>I don't know you have me worried already.
    >>>I guess for you I just say RTFM.
    >>>If you think that is harsh then don't ask a 2nd grade question yet
    >>>claim/pretend to be some sorta system specialists.

    >>
    >>Hey, ease up, this is comp.lang.python, remember.
    >>
    >>
    >>>You tried searching the archives first I am sure.
    >>>Go here http://www.python.org and *read*, come back when you are
    >>>really stuck.
    >>>M.E.Farmer
    >>>P.S. YES the __ matter, they identify special methods ! __init__ is

    >
    > the
    >
    >>>class CONSTRUCTOR.
    >>>

    >>
    >>Next time, could we try exchanging the body of the message and the

    >
    > PS?
    >
    >>That way you could have omitted the PS when you got half way through

    >
    > it
    >
    >>and realised you were just wasting your time and everyone else's ...
    >>
    >>got-out-the-wrong-side-of-bed-ly y'rs - steve
    >>--
    >>Meet the Python developers and your c.l.py favorites March 23-25
    >>Come to PyCon DC 2005 http://www.pycon.org/
    >>Steve Holden http://www.holdenwewb.com

    >
    > P.S. And in an effort to keep on topic...PYCON!!
    > steve,
    > I stand by what I said.
    > Teach a man to fish feed him for a lifetime.
    > Re-read it, memorize it, and keep it near.
    > I read comp.lang.py for 3 years before I posted anything, and then i
    > posted an ANSWER!
    > I don't go around asking dirt simple questions that would be solved
    > with a quick read of the docs, usenet archives , Google, books that
    > have been written about Python,etc.... He should have been *reading*
    > not *posting*.
    > I can not understand why you have a problem with me pointing out he
    > should read the documentation. Why do you think RTFM exist, for people
    > like that, they are a timesink. He can redeem himself if he just goes
    > and reads a little and comes back looking like he made some effort.
    > This guy has a 6 mile sig that says he ought to know better. Had he
    > come with a different sig *maybe* and a question that did not scream
    > '''HEY I WANT YOU TO ANSWER EVERYTHING FOR ME BECAUSE I CAN NOT EVEN
    > READ THE BASIC DOCUMENTATION ON MY OWN'''.
    >
    >
    >>Next time, could we try exchanging the body of the message and the

    >
    > PS?
    >
    >>That way you could have omitted the PS when you got half way through

    >
    > it
    >
    >>and realised you were just wasting your time and everyone else's ...

    >
    >
    > I tell him where he is wrong first then I answer the question, sounds
    > like *YOU* ....Now I have your attention.
    > What do you think that post was meant to do? Snap him off at the root?
    > Make him cry? Maybe it was to nudge him to read the docs, so he can
    > *learn* on his own.
    > Next time you could just write my post for me! That way I can only
    > waste as much time as you deem acceptable! Now that I think about it,
    > if we just answer every question every poster has about any detail of
    > Python, then we can all sing along and hold hands, who needs to write
    > documentation or even books about Python look at all the time we will
    > save...
    >
    >
    >>got-out-the-wrong-side-of-bed-ly y'rs - steve

    >
    > Which-side is-the wrong-side-ly yr's - M.E.Farmer
    >

    Well, actually my point was that if we just save time by not answering
    such questions we avoid a reputation for hostility while still
    encouraging people to use other resources. But anyway, thanks for saying
    "PyCon"!

    regards
    Steve
    --
    Meet the Python developers and your c.l.py favorites March 23-25
    Come to PyCon DC 2005 http://www.pycon.org/
    Steve Holden http://www.holdenweb.com/
     
    Steve Holden, Feb 8, 2005
    #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. Miki Tebeka
    Replies:
    1
    Views:
    338
    Duncan Booth
    Feb 7, 2005
  2. Jeffrey Borkent
    Replies:
    1
    Views:
    346
    Steven Bethard
    Feb 7, 2005
  3. Ray Schumacher

    "parent" in a class __init__ def?

    Ray Schumacher, Jun 10, 2006, in forum: Python
    Replies:
    6
    Views:
    320
    bruno at modulix
    Jun 13, 2006
  4. Ray Schumacher

    "parent" in a class __init__ def?

    Ray Schumacher, Jun 11, 2006, in forum: Python
    Replies:
    0
    Views:
    259
    Ray Schumacher
    Jun 11, 2006
  5. Replies:
    7
    Views:
    181
Loading...

Share This Page