zeitgeist module: Hide get_ and set_ from API

Bug #489947 reported by Siegfried Gevatter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Invalid
Low
Unassigned

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).

Changed in zeitgeist:
importance: Undecided → Low
Revision history for this message
Siegfried Gevatter (rainct) wrote :

Don't care enough as to argue with thekorn -.-.

Changed in zeitgeist:
status: New → Invalid
Revision history for this message
Markus Korn (thekorn) wrote :

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"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.