Why does python not have a mechanism for data hiding?

Fuzzyman fuzzyman at gmail.com
Sun May 25 08:11:18 EDT 2008


On May 25, 9:47 am, vivai... at gmail.com (Ville M. Vainio) wrote:
> Fuzzyman <fuzzy... 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?
>


We're using IronPython. I haven't looked at pyprotocols but I know the
Zope interface package is at least partly written in C. Our
spreadsheet object model is very 'performance sensitive', so that's a
consideration. We should definitely explore the prior art in this area
before we implement anything ourselves.

Thanks

Michael Foord
http://www.ironpythoninaction.com/

> 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