Re: [Tutor] Protected methods/variables

2006-04-05 Thread Kent Johnson
w chun wrote: > On 4/4/06, Kent Johnson <[EMAIL PROTECTED]> wrote: >> Mike Hansen wrote: > - you can use __slots__ to restrict arbirtrary creation of (dynamic) > instrance attributes You can do this, but it is generally considered a misuse of __slots__ and potentially problem

Re: [Tutor] Protected methods/variables

2006-04-05 Thread w chun
On 4/4/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Mike Hansen wrote: > >>> - you can use __slots__ to restrict arbirtrary creation of > >> (dynamic) > >>> instrance attributes > >> You can do this, but it is generally considered a misuse of > >> __slots__ and potentially problematic. what speci

Re: [Tutor] Protected methods/variables

2006-04-04 Thread Kent Johnson
Mike Hansen wrote: >>> - you can use __slots__ to restrict arbirtrary creation of >> (dynamic) >>> instrance attributes >> You can do this, but it is generally considered a misuse of >> __slots__ and potentially problematic. >> > > I'll bite. What is the proper/intended use of __slots__? Does i

Re: [Tutor] Protected methods/variables

2006-04-04 Thread Mike Hansen
> > - you can use __slots__ to restrict arbirtrary creation of > (dynamic) > > instrance attributes > > You can do this, but it is generally considered a misuse of > __slots__ and potentially problematic. > I'll bite. What is the proper/intended use of __slots__? Does it have something to do

Re: [Tutor] Protected methods/variables

2006-04-04 Thread Kent Johnson
w chun wrote: >> I have missed protected method/variables in Python. How do you declare >> methods/variables used only by a class and their derived classes? > > hi KtalĂ , > > welcome to Python! you missed "protection" in OOP with Python bceause > there are no such declarations in Python! > > 1)

Re: [Tutor] Protected methods/variables

2006-04-04 Thread w chun
> I have missed protected method/variables in Python. How do you declare > methods/variables used only by a class and their derived classes? hi KtalĂ , welcome to Python! you missed "protection" in OOP with Python bceause there are no such declarations in Python! 1) there is a privacy *hint*, wh

Re: [Tutor] Protected methods/variables

2006-04-04 Thread Alan Gauld
"Miquel Oliete" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have been programming in object oriented languages for several years > and I'm learning python now. Congratulations :-) > I have missed protected method/variables in Python. In what sense have you missed them? Have

[Tutor] Protected methods/variables

2006-04-04 Thread Miquel Oliete
Hello everybody I have been programming in object oriented languages for several years and I'm learning python now. I have missed protected method/variables in Python. How do you declare methods/variables used only by a class and their derived classes? Thanks in advance -- Miquel Oliete (a.