What if we make objects with __str__ methods implicitly convertible to
QString/QByteArray? Current this is not supported, as the following
code fails:

from PySide.QtCore import *

class Foo(object):
    def __str__(self):
        return '42'

a = Foo()
b = QObject()
b.setObjectName(a)

Traceback (most recent call last):
  File "/tmp/foo.py", line 12, in <module>
    b.setObjectName(a)
TypeError: 'PySide.QtCore.QObject.setObjectName' called with wrong
argument types:
  PySide.QtCore.QObject.setObjectName(Foo)
Supported signatures:
  PySide.QtCore.QObject.setObjectName(QString)

One potential issue is the relationship with objects with __repr__
method, as it is called if __str__ isn't present.

-- 
Lauro Moura
INdT - Instituto Nokia de Tecnologia
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to