From f3faaf2d29e57733a4d1c2a05534add46d6491bc Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Sun, 20 Jul 2008 18:55:53 +0000 Subject: [PATCH] 22: Named.name property now calls _get_name() at first evaluation to make changing the behaviour in subclasses easier --- ipalib/base.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ipalib/base.py b/ipalib/base.py index 3c302369f..09355f41b 100644 --- a/ipalib/base.py +++ b/ipalib/base.py @@ -129,8 +129,15 @@ class NameSpace(object): class Named(object): - def __get_name(self): + __name = None + + def _get_name(self): 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)