Discuss / Python / 返回的resolution 类型是class 打印出错

返回的resolution 类型是class 打印出错

Topic source
    class Screen(object):
    @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

<class 'property'>
resolution= <property object at 0x00000000052B9D68>

装饰器只有setter ?


  • 1

Reply