Why does python not have a mechanism for data hiding?

Ben Finney bignose+hates-spam at benfinney.id.au
Sat May 24 10:00:32 EDT 2008


Ben Finney <bignose+hates-spam at benfinney.id.au> writes:

> If you want the users of your code to know that an attribute should
> not be used as a public API for the code, use the convention of
> naming the attribute with a single leading underscore. This is a
> string signal that the attribute is part of the implementation, not
> the interface.

Quite apart from whether it's a string signal, I meant to write that
it's a *strong* signal.

-- 
 \        "Some people, when confronted with a problem, think 'I know, |
  `\       I'll use regular expressions'. Now they have two problems." |
_o__)                           —Jamie Zawinski, in alt.religion.emacs |
Ben Finney



More information about the Python-list mailing list