[issue18181] PEP447: Add type.__getdescriptor__

Ronald Oussoren report at bugs.python.org
Sat Jul 25 14:55:18 CEST 2015


Ronald Oussoren added the comment:

pep447-2015-07-25-v2.txt changes two things w.r.t. the patch earlier today:

1) The performance problems w.r.t. the method_cache are gone

2) Added code for handling python exceptions other than AttributeError in
   calls to __getdescriptor__. 

   This code requires some tests to make sure the error handling code 
   is correct.

The new patch also adds some more tests, and adds extra MCACHE_STATS counters. Those aren't part of the proposal but were helpful to find the problem w.r.t. 1).

As I mentioned before implementing __getdescriptor__ in Python is bad for performance of instances of that metaclass. AFAIK that cannot be helped, doing that will just execute a lot more Python code.

----------
Added file: http://bugs.python.org/file40017/pep447-2015-07-25-v2.txt

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18181>
_______________________________________


More information about the Python-bugs-list mailing list