Re: About Encapsulation

2005-05-04 Thread Bruno Desthuilliers
Adriano Monteiro a écrit : > Hey folks, > > I wanna know more about encapsulation in python. Is it fully suported? > How can I define the encapsulation statements for methods and attributes? If you're thinking of things like private/protected/public: class Foo(object): def __init__(self):

Re: About Encapsulation

2005-05-04 Thread Sébastien Boisgérault
You mean private, protected, public, that kind of stuff ? They do not exist in Python. Conventionally if you don't want the user of a class to access a method or attribute, you use the prefix _ ; class K(object): _a = 1 def __init__(self, val): self.arg = val self._hidde