On 11.01.2011 13:46, ext Thomas Perl wrote:
This way, I get an even nicer output (for debugging), but of course I
have to write that myself instead of just saying "print points". What
about objects that cannot be instantiated by themselves, and are
rather created by some factory method of another class? Should the
__repr__ for such objects just be an informative representation that
isn't an executable Python expression?
I think the upstream Python recommendation [1] is very sensible:
If at all possible, this should look like a valid Python expression
that could be used to recreate an object with the same value (given
an appropriate environment). If this is not possible, a string of
the form <...some useful description...> should be returned.
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__
Cheers,
ma.
_______________________________________________
PySide mailing list
PySide@lists.openbossa.org
http://lists.openbossa.org/listinfo/pyside