Re: [Cython] hasattr() swallows any exception (Py<3.2)

2011-02-23 Thread Stefan Behnel
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 hasatt

Re: [Cython] hasattr() swallows any exception (Py<3.2)

2011-02-22 Thread Lisandro Dalcin
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 us

Re: [Cython] hasattr() swallows any exception (Py<3.2)

2011-02-22 Thread Lisandro Dalcin
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, m

Re: [Cython] hasattr() swallows any exception (Py<3.2)

2011-02-22 Thread Stefan Behnel
Lisandro Dalcin, 22.02.2011 21:41: Take a look here: http://bugs.python.org/issue9666 'hasattr' default behaviour should be changed to suppress only AttributeError exceptions. Other should pass through. +1, I think I even faintly recall that discussion. What a lengthy thread... http://mail.p

[Cython] hasattr() swallows any exception (Py<3.2)

2011-02-22 Thread Lisandro Dalcin
Take a look here: http://bugs.python.org/issue9666 'hasattr' default behaviour should be changed to suppress only AttributeError exceptions. Other should pass through. Should we do something about this in Cython? We currently use PyObject_HasAttr(), but even in Python 3.2 this is not the same as