Accessors in Python (getters and setters)

Gerhard Fiedler gelists at gmail.com
Thu Jul 13 09:43:02 EDT 2006


On 2006-07-13 06:03:40, Bruno Desthuilliers wrote:

>> [...] the underscore way to mark private entities. Maybe this doesn't
>> work as I think it does
> 
> If you think that single leading underscores have a special meaning for
> the compiler/interpreter, then you got it wrong. It's a convention. Like
> using ALL_CAPS for pseudo-constants. Nothing prevents you from accessing
> implementation or modifying "constants" - but then you're on your own
> and must not complain when something breaks.

I really did get that wrong. But this makes actually more sense,
considering the bigger picture (or what I saw from it, so far). 

Thanks, 
Gerhard




More information about the Python-list mailing list