class C(object):
    def __init__(self):
        self._x = None

    @property
    def x(self):
        """I'm the 'x' property."""
        print "getter of x called"
        return self._x

    @x.setter
    def x(self, value):
        print "setter of x called"
        self._x = value

    @x.deleter
    def x(self):
        print "deleter of x called"
        del self._x


'Python' 카테고리의 다른 글

[Flask] Flask - wsgi - nginx 연동.  (0) 2017.05.15
[Python] YAPF  (0) 2017.03.11
[Python] 공부해야 할 것.  (0) 2017.02.15
[Python]pywin32 설치기.  (0) 2016.12.15
python vim설정  (0) 2016.12.05
Posted by C마노
,