Encapsulation unpythonic?

random832 at fastmail.us random832 at fastmail.us
Wed Aug 21 12:52:06 EDT 2013


On Mon, Aug 19, 2013, at 3:05, Steven D'Aprano wrote:
> In this toy example, both parties are at fault: the author of Parrot for 
> unnecessary data-hiding of something which is so obviously a useful piece 
> of information and should be part of the public interface,

It may wish to be notified when its name changes, and so have a name
property. The subclass may want to use a variable called _name for some
other purpose. (maybe "name" isn't the best example).

Examples often look pathological when you simplify out the bit that
makes them make sense.

-- 
Random832



More information about the Python-list mailing list