Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Ethan Furman Newsgroups: comp.lang.python Subject: Re: Descriptors vs Property Date: Wed, 16 Mar 2016 08:15:19 -0700 Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de pCRVDOlSPNIJx6U9ZKQzfwbjCdOnplFE71pdPX68vSxw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'implements': 0.07; '@property': 0.09; 'descriptor': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'decorator': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'follows': 0.29; 'methods.': 0.29; '~ethan~': 0.29; 'protocol': 0.35; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'to:addr:python.org': 0.40; 'charset:windows-1252': 0.62; 'more': 0.63; 'decorator,': 0.84; 'subject:Property': 0.91 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105045 On 03/11/2016 09:59 PM, Veek. M wrote: > A property uses the @property decorator and has @foo.setter > @foo.deleter. > > A descriptor follows the descriptor protocol and implements the __get__ > __set__ __delete__ methods. `property` is a descriptor combined with a decorator, so is a little more complex to understand. -- ~Ethan~