

def make_property(attr):
    types = {
        'anchor_x': 'int',
        'anchor_y': 'int',
        'anchor': '(int, int)',
    }

    def set_attr():

        def inner(self, value):
            setattr(self, ('transform_' + attr), value)
        return inner

    def get_attr():

        def inner(self):
            return getattr(self, ('transform_' + attr))
        return inner
    return property(get_attr(), set_attr(), doc=('a property to get fast access to transform_%s\n\n            :type: %s' % (attr, types[attr])))

dataset/ETHPy150Open los-cocos/cocos/cocos/cocosnode.py CocosNode.make_property/original