22: Named.name property now calls _get_name() at first evaluation to make changing the behaviour in subclasses easier

This commit is contained in:
Jason Gerard DeRose 2008-07-20 18:55:53 +00:00
parent 97a3520d37
commit f3faaf2d29

View File

@ -129,8 +129,15 @@ class NameSpace(object):
class Named(object): class Named(object):
def __get_name(self): __name = None
def _get_name(self):
return self.__class__.__name__ return self.__class__.__name__
def __get_name(self):
if self.__name is None:
self.__name = self._get_name()
return self.__name
name = property(__get_name) name = property(__get_name)