On Tue, Aug 24, 2010 at 7:43 AM, Matti Airas <[email protected]> wrote:
> Hi,
>
> I began going through the examples, fixing any broken ones and reporting
> bugs against any issues. This is what I immediately found:
>
> The slightly modified calculatorform script in
>
> http://bugs.openbossa.org/attachment.cgi?id=59
>
> calls QLabel.setText with an int argument instead of the expected str. Now,
> what's the expectation: should there be an error message (like now) or
> should PySide automatically convert types to strs in such cases? If the
> latter, which types? Built-in ones? Any types (using __repr__)?

Just my own bits on this: I think "automatic conversion" from any type
to str in function calling is not a good thing, because it might hide
bugs (e.g. when the wrong variable is passed to a function), and in
fact Python does not do that with its builtin functions (please
provide some example of this, if that's the case). Functions that
require strings usually require you first converting the argument
using str() or "%s", **unless** the variable being passed is a subtype
of str or has the string protocol, in which case the "conversion" is
expected (technically, I think a conversion does not occur).

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

Reply via email to