Why less emphasis on private data?

sturlamolden sturlamolden at yahoo.no
Tue Jan 9 06:00:43 EST 2007


time.swift at gmail.com wrote:

> I let the user change the internal state of the engine, I have no
> assurances that my product (the engine) is doing its job...

How would you proceed to protect this inner states? In C++ private
members they can be accessed through a cast to void pointer. In Java it
can be done through introspection. In C# it can be done through
introspection or casting to void pointer in an 'unsafe' block. There is
no way you can protect inner states of an object, it is just an
illusion you may have.

Python have properties as well. Properties has nothing to do with
hiding attributes.




More information about the Python-list mailing list