Why does python not have a mechanism for data hiding?

Ville M. Vainio vivainio at gmail.com
Sun May 25 04:47:01 EDT 2008


Fuzzyman <fuzzyman at gmail.com> writes:


>> Perhaps a lint-like validation tool would be optimal for this
>> problem...
>
> So we can refuse to execute their code if they use private APIs?

No, but it could complain and point out the exact offending lines,
pointing their development effort to right direction.

> Proxying so that we can really hide our internal APIs is a better
> solution.

How about pyprotocols and other interface packages?

Proxying is pretty workable too, and it easily makes sense that the
official API objects should be different from the logic executing
objects.



More information about the Python-list mailing list