On Tue, May 20, 2008 at 5:38 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Thankfully this issue was fixed in Python 2.6 and 3.0. In newer versions > of Python hasattr() only swallows exception based on the Exception class > but not BaseExceptions. We should make sure all code in the core behaves > the same way. Exceptions based on BaseException must *never* be > swallowed. The behavior may even be worse a macro and it should be > documented in large, friendly and red letters in the C API docs. *wink*
Speaking of the C-API, I was thinking of introducing a new function called PyObject_SafeHasAttr that functions just like PyObject_HasAttr except it can fail. > > Christian > -- Cheers, Benjamin Peterson "There's no place like 127.0.0.1." _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com