(original) (raw)
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 hitsUnless the average use of \_\_getattr\_\_ serve in excess of 13 members each, property is the most popular technique of the three.
"def \_\_getattr\_\_" 28 hits
"def \_\_getattribute\_\_(" 2 hits
/arry