I'm a bit tired of typing MyLongAdvancedClassName._template to access class variables. They are sometimes constants, but not always. You will say I want to use module globals in case of constants. But I want to have them defined near to the place of usage, not in the beginning of file. I also don't like locals, because in case of a long string you will reallocate it on each call.
Is it possible to do something like the following:
_c = MyLongAdvancedClassName
class MyLongAdvancedClassName:
...
_template = " My long advanced text %i "
def method(self):
print _c._template