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.
/arry