473,413 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

def __init__ question in a class definition

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
je*************@adelaide.edu.au
---------------------------------
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.

Jul 18 '05 #1
4 1518
>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.

Jul 18 '05 #2
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/
Jul 18 '05 #3
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

Jul 18 '05 #4
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/
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: user | last post by:
I have gotten properties to respond correctly, but when I try to do it in __init__: class foo: def getter(self): return "hello" def __init__(self):
3
by: Zunbeltz Izaola | last post by:
Hi, I'm playing with __slot__ (new class) and the __init__ method of my class. I want the arguments of __init__ to be keywords and that the method initialize all the attributes in __slot__ to...
3
by: paul kölle | last post by:
Hi list, in the course of writing a small app, I tried to design a class, which would allow to derive its behaviour solely from its name, so that I would be able to write one abstract class with...
1
by: Jeffrey Borkent | last post by:
Hi There, Please let me rephrase the problem as many people misunderstood what i was trying to ask. I know that the __init__ is the class constructor, that was not my question. under the...
2
by: Thomas Bartkus | last post by:
If I insert an __init__ method in my own class definition, it is incumbent upon me to call the __init__ of any declared ancester to my new class object because my __init__ will override that of any...
6
by: Ray Schumacher | last post by:
What is the feeling on using "parent" in a class definition that class methods can refer to, vs. some other organization ? Should all relevant objects/vars just be passed into the method as needed?...
16
by: digitalorganics | last post by:
What's the difference between initializing class variables within the class definition directly versus initializing them within the class's __init__ method? Is there a reason, perhaps in certain...
10
by: ryanshewcraft | last post by:
Let me start with my disclaimer by saying I'm new to computer programming and have doing it for the past three weeks. I may not be completely correct with all the jargon, so please bear with me. ...
25
by: Erik Lind | last post by:
I'm new to Python, and OOP. I've read most of Mark Lutz's book and more online and can write simple modules, but I still don't get when __init__ needs to be used as opposed to creating a class...
43
by: kenneth | last post by:
Dear all, I have encountered this weird problem. I have a class definition with an __init__ argument 'd' which defaults to {}. This argument is put in the 'self.d' attribute at initialization...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.