On Tue, Jan 11, 2011 at 8:57 AM, Matti Airas <[email protected]> wrote: > > Of course, there might be some implementation difficulties for > distinguishing between the two cases in the Shiboken generator. Are there? > > [1] http://docs.python.org/reference/datamodel.html#object.__repr__ >
I don't think so as this new __repr__ seems to be pretty similar to the __reduce__ function, which returns the proper information needed to build an identical copy: The rebuild function (almost always the constructor) and the arguments to this function. For classes with __reduce__, __repr could be implemented like the following snippet. def __repr__(self): klass, args = self.__reduce__() return '%s(%s) % (type.__name__, ', '.join(map(str,args))) The only problem would be with types where the rebuild function isn't the constructor, but AFAIR we don't have this case in PySide. -- Lauro Moura INdT - Instituto Nokia de Tecnologia _______________________________________________ PySide mailing list [email protected] http://lists.openbossa.org/listinfo/pyside
