Restrictive APIs for Python

Roberto Bonvallet Roberto.Bonvallet at cern.ch
Fri Dec 15 11:10:37 EST 2006


Will Ware wrote:
> Python has no inherent provision for a restrictive API that blocks
> accesses to methods and variables outside an allowed set.
> Inexperienced Python programmers may fail to adhere to an agreed-upon
> API, directly accessing the private internals of a class.

Just don't document those private internals.
Or document that they must not be accessed directly.

-- 
Roberto Bonvallet



More information about the Python-list mailing list