[issue18181] PEP447: Add type.__getdescriptor__

2016-07-24 Thread Ronald Oussoren
Changes by Ronald Oussoren : Added file: http://bugs.python.org/file43853/pep447-2015-07-26.txt ___ Python tracker ___ ___ Python-bugs-list ma

[issue18181] PEP447: Add type.__getdescriptor__

2015-07-26 Thread Ronald Oussoren
Ronald Oussoren added the comment: Todays version of the patch adds more tests, especially for exceptions in __getdescriptor__ during the lookup of special methods. Those tests were added because the C code couldn't get exceptions other than AttributeError before this patch and can get those

[issue18181] PEP447: Add type.__getdescriptor__

2015-07-25 Thread Ronald Oussoren
Ronald Oussoren added the comment: Note: the error handling code for exceptions in __getdescriptor__ definitely isn't good enough yet. I'm writing tests and am hunting down the problems those tests find. I'm getting closer and will post a new version when I think I've found all bugs. Probabl

[issue18181] PEP447: Add type.__getdescriptor__

2015-07-25 Thread Ronald Oussoren
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 req

[issue18181] PEP447: Add type.__getdescriptor__

2015-07-25 Thread Ronald Oussoren
Ronald Oussoren added the comment: The attached micro benchmark indicates that method_cache in typeobject.c isn't used when using my patch. I'll have too look into that. Other than that benchmarks results look OK (but: not using the method_cache is unacceptable as this most definitely changes

[issue18181] PEP447: Add type.__getdescriptor__

2015-07-25 Thread Ronald Oussoren
Ronald Oussoren added the comment: I've attached a new version of the patch (pep447-2015-07-25.txt). Changes in this version of the patch: 1) Works with the current trunk (as in "all tests pass") 2) Types in C must explicitly set Py_TPFLAGS_GETDESCRIPTOR in tp_flags to enable the tp_getdes

[issue18181] PEP447: Add type.__getdescriptor__

2015-07-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: Updated the title and versions, will work on an updated PEP and patch during and after EP'15. -- title: PEP447: Add type.__locallookup__ -> PEP447: Add type.__getdescriptor__ versions: +Python 3.6 -Python 3.4 ___ Py