> On Wed, Apr 23, 2008 at 10:40 PM, "Martin v. Löwis" <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > py> time % 60, time//60%60, time//3600%24, time//(3600*24) > (28, 7, 0, 22) > > the 3600 and 3600*24 was what I was trying to avoid.
This is getting off-topic, so you don't need to answer; I still ask: Why??? It's still *shorter* than your reduce version, and much much much more legible. Readability counts. > I like the divmod > solution. You can also use it in the reduce :) > reduce(lambda a, b: divmod(a[0], b) + a[1:], [(t,), 60, 60, 24])[::-1] Even after knowing what this does, I still cannot easily understand how it does that. I think having reduce produce a growing value, and passing it an inhomogeneous list, is just deep abuse. In any case, writing multiple lines is good, writing a single line only is bad. Regards, Martin _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com