Hi! 2011/1/17 Hugo Parente Lima <hugo.l...@openbossa.org>: > On Monday 17 January 2011 13:07:35 Matti Airas wrote: >> [1] http://bugs.openbossa.org/show_bug.cgi?id=606 > > Better than a toTuple method is to add the possibility to create tuples from > those objects, e.g.: > > p = QPoint(1, 2) > t = tuple(p) # (1,2) > > It's better because it doesn't add any "visible" method to the API, besides > being beauty IMO =]
Looks beautiful and very Pythonic to me :) +1 for implementing that at some point in the future. As for the request for ".ymd(), .hms(), .hmsm(), .ymdhms(), .ymdhmsm()", this could be solved by slicing the resulting tuple (if it provides all information), and only providing the "most verbose" variant (ymdhmsm). Maybe even in the order so that it can be passed to Python's built-in "datetime.datetime" object constructor? For the QUrl example in the bug report: One can use urlparse.urlsplit and urlparse.urlunsplit in the Python standard library for that and get/pass the full URL from/to QUrl, avoiding the need for API additions there. Thanks, Thomas _______________________________________________ PySide mailing list PySide@lists.openbossa.org http://lists.openbossa.org/listinfo/pyside