Writing "pythonish" code
Toby A Inkster
usenet200701 at tobyinkster.co.uk
Fri Feb 2 08:08:02 EST 2007
Mizipzor wrote:
> One thing is that in c++ im used to have private members in classes and
> no member is altered except through the public functions of the class.
By convention, class members starting with a single underscore are
considered private.
This is much the same as the convention that on UNIX, files that start with
a dot are considered hidden -- there is nothing actually *preventing* a
programme from showing you these files in a directory listing, but by
convention it won't, unless you explicitly ask to see them.
Class members starting with a double underscore are "mangled" which makes
it more difficult for other code (even subclasses!) to access the member.
Difficult though -- not impossible.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
More information about the Python-list
mailing list