[Python-Dev] PEP 549: Instance Properties (aka: module properties)

Larry Hastings larry at hastings.org
Thu Sep 7 19:00:04 EDT 2017

On 09/07/2017 03:49 PM, Larry Hastings wrote:
> Excluding Lib/test, there are 375 uses of "@property" in the stdlib in 
> trunk, 60 uses of __getattr__, and 34 of __getattribute__.

I spent a minute looking at the output and realized there were a bunch 
of hits inside pydoc_data/topics.py, aka documentation.  And then I 
realized I was only interested in definitions, not docs or calls or 
other hackery.

Removing pydoc_data/topics.py and changing the search terms results in:

    "@property" 375 hits
    "def __getattr__" 28 hits
    "def __getattribute__(" 2 hits

Unless the average use of __getattr__ serve in excess of 13 members 
each, property is the most popular technique of the three.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170907/00d1a18f/attachment-0001.html>

More information about the Python-Dev mailing list