Hacker News new | ask | show | jobs
by bcj 4315 days ago
Python has a solution to this. There are decorators that allow you to access methods as if they are properties:

    class Foo(object):
        def __init__(self, bar):
            self._bar = bar

        @property
        def bar(self):
            return self._bar

        @bar.setter
        def bar(self, value):
            self._bar = value
1 comments

As does Objective-C, and JavaScript.