Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Will python never intend to support private, protected and public?

Reply
Thread Tools

Re: Will python never intend to support private, protected and public?

 
 
Simon Brunning
Guest
Posts: n/a
 
      09-28-2005
On 9/28/05, Tony Meyer <(E-Mail Removed)> wrote:
> I'm not sure why I haven't seen this mentioned yet, but a leading
> double-underscore does really make a member private:


I thought about it, but I didn't mention it in the end because this
feature ("name mangling") isn't intended as a mechanism for making
things private - it's intended to prevent namespace clashes when doing
multiple inheritance. It can be used to make things private, true, but
that's abusing the feature, just as using __slots__ as a way of
"declaring variables" is an abuse - (__slots__ is a memory
optimisation feature).

--
Cheers,
Simon B,
http://www.velocityreviews.com/forums/(E-Mail Removed),
http://www.brunningonline.net/simon/blog/
 
Reply With Quote
 
 
 
 
Paul Rubin
Guest
Posts: n/a
 
      09-28-2005
Simon Brunning <(E-Mail Removed)> writes:
> I thought about it, but I didn't mention it in the end because this
> feature ("name mangling") isn't intended as a mechanism for making
> things private - it's intended to prevent namespace clashes when doing
> multiple inheritance. It can be used to make things private, true, but
> that's abusing the feature, just as using __slots__ as a way of
> "declaring variables" is an abuse - (__slots__ is a memory
> optimisation feature).


Good explanation.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Will python never intend to support private, protected and public? Steve Holden Python 2 10-08-2005 07:09 AM
Re: Will python never intend to support private, protected and public? Simon Brunning Python 10 10-08-2005 07:09 AM
Re: Will python never intend to support private, protected and public? Chris Gonnerman Python 158 10-05-2005 12:48 AM
Re: Will python never intend to support private, protected and public? Tony Meyer Python 0 09-29-2005 12:11 AM
Re: Will python never intend to support private, protected and public? Tony Meyer Python 2 09-28-2005 01:25 PM



Advertisments