Discuss / Python / 不知道装饰器可不可以直接写在Screen上?不过好像会带来其他问题

不知道装饰器可不可以直接写在Screen上?不过好像会带来其他问题

Topic source

希声小唱

#1 Created at ... [Delete] [Delete and Lock User]
    @property
    def width(self):
        return self._width
    @width.setter
    def width(self, value):
        self._width = value

    @property
    def height(self):
        return self._height
    @height.setter
    def height(self, value):
        self._height = value

    @property
    def resolution(self):
        return self._width * self._height

  • 1

Reply