On Dec 12, 2:07 am, "Emanuele D'Arrigo" <[EMAIL PROTECTED]> wrote: > I.e. if I have a class with two methods, doSomethingSafe() and > doSomethingDangerous(), is there a way to prevent another module from > executing doSomethingDangerous() but allow the execution of > doSomethingSafe()? > > My understanding is that in python this is not possible. Can you > confirm?
Your understanding is correct. The Python convention is to prefix non-public methods/classes etc with an underscore, as in _doSomethingDangerous(). This is meant to indicate to anyone using your module that they shouldn't use this function, at least not without having a good understanding of what it does. -- http://mail.python.org/mailman/listinfo/python-list