[Cython] hasattr() swallows any exception (Py<3.2)
stefan_ml at behnel.de
Wed Feb 23 14:42:22 CET 2011
Lisandro Dalcin, 23.02.2011 01:59:
> On 22 February 2011 19:09, Lisandro Dalcin wrote:
>> On 22 February 2011 18:21, Stefan Behnel wrote:
>>> Lisandro Dalcin, 22.02.2011 21:41:
>>>> I'm inclined to fix the behavior for ALL Python
>>>> versions to suppress only AttributeError.
>>> How? Would you implement a hasattr() helper that uses PyObject_GetAttr() and
>>> Does The Right Thing?
>> Yes, more or less the implementation of builtin_hasattr from
>> bltinmodule.c from Py3.2
>>> In any case, I personally don't care so much about hasattr(), but I'm +1 for
>>> Python compatibility, and +1 for getting the fixed Py3.2 behaviour in all
>>> Python versions. There's a reason this was fixed in CPython, it's a pretty
>>> clear bug.
>> OK, I'll go for it. Thanks.
Looks good. Thanks.
More information about the cython-devel