![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveWhat python idioms for private, protected and public?
From: Michael Schneider <michaelschneider@fuse.net>
Date: Thu Sep 29 2005 - 16:08:28 CEST
I have been following this thread with great interest.
I have been coding in C++ since the late 80's and Java since the late 90's.
I do use private in these languages, with accessors to get at internal
This has become an ingrained idiom for me. When I create a python
Hare are the places where private is useful to me:
Design Intent:
1) mark an object as dirty in a setter (anytime the object is changed,
2) enforce value constraints (even if just during debugging)
3) lazy init, don't bring the data in until needed
4) adding debug info
5) .... more here????
I do write code that violates private
I usually violate private when adding an aspect to a class, and
I really like the C# properties, you can access data with a data
I like the data access syntax, better then the set/get functions. I
It would be easy for me to say "Add public and private to python so I
Thanks
|