On Fri, Oct 23, 2009 at 7:20 AM, Matti Airas <[email protected]> wrote:
> So, we'd have to throw exceptions in all the methods that natively report
> errors by return values. (I believe having only some classes throw
> exceptions would be the worst-case situation from the Python coder's point
> of view.)
>
> How much of the process could be automated? At least the return values would
> need to be checked on method-by-method basis, which sounds like a humongous
> task, especially if some meaningful exceptions would be thrown.

I don't know how consistent the return error values are in Qt, but in
Gtk+ most (all?) functions that need to return some error message have
a GError** parameter where the error information is stored. This way,
for functions that take a GError**, binding generators automatically
turn it into proper Python exceptions.

I believe that for the implementation to become feasible, wee need to
add some typesystem syntax to specify how a method handles return
error code and how to fetch the error message, so there would be no
need to write (error-prone) custom code.

My two cents,
-- 
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to