zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #00458
[Bug 489947] Re: zeitgeist module: Hide get_ and set_ from API
IMHO setting the bug to invalid is the right decision. Just in case
anyone looks for a solution for it in the future, use sth. like this
class Test(object):
def __init__(self):
self.__value = 5
def get_value(self):
return self.__value
def set_value(self, v):
self.__value = v
value = property(get_value, set_value)
del get_value, set_value
if __name__ == "__main__":
t = Test()
print t.value
t.value = 8
print t.value
try:
t.get_value()
except AttributeError:
print "YEAH"
--
zeitgeist module: Hide get_ and set_ from API
https://bugs.launchpad.net/bugs/489947
You received this bug notification because you are a member of
Zeitgeist-Engine, which is the registrant for Zeitgeist Framework.
Status in Zeitgeist Framework: Invalid
Bug description:
Currently the properties of Event and Subject can be accessed as .name or as .get_name/.set_name The later functions are redundant so they should be made private (renamed to ._get_name and ._set_name).
References