On 03/21/13 17:41, Oskar Hahn wrote:
>>  
>> -        for receiver, value in default_config_value.send(sender='config',
>> -                                                         key=key):
>> -            if value is not None:
>> -                return value
>> -        if settings.DEBUG:
>> -            print "No default value for: %s" % key
>> -        return None
>> +    def _get_variables(self):
> 
> In other languages methods which start with an underscore are private methods. This means, that this methods can not be used from other packages. In python, there is no such limitation. But some programmers use the the underscore to show, that this method should not be used in other modules. I don't like this because 1. If I don't wont, that other programmers to use a method, I should document it in the docstring, not in the name of the method. 2. I do not know, what other programmers want. For example, someone could deviate your class and rewrite this methods.
Just for the records, I have to strongly disagree here ;)

The undscore-prefix-is-private-API convention is very strong within the
python community. Yes, you _can_ use them, but any serious python
programmer knows that he does so at his own peril.

The convention is so strong in fact that it is even supported by the
Python core (e.g help(obj) will not show _underscore methods so you only
see the public API).

In short: If you consider something a private API *ALWAYS* prefix it
with an underscore! If have *have* to read the docstring to know I'm not
supposed to call this API you're doing it wrong!

That doesn't stop you from also stating it in the docstring (for the
benefit of new python programmer who don't know the convention yet).