STINNER Victor <[EMAIL PROTECTED]> added the comment: >>> (t - epoch) // timedelta(seconds=1)
I don't like this syntax, because I can't guess the result unit: datetime - datetime -> timedelta but: timedelta / timedelta -> seconds? days? nanoseconds? If you example, you used timedelta(seconds=1), but what is the result unit if you use timedelta(hours=1)? or timedelta(days=1, microseconds=1)? The problem is that timedelta has no unit (or has multiple units), whereas timedelta.toseconds() are seconds. So about your example: >>> (t - epoch).toseconds() --> fractional seconds >>> int((t - epoch).toseconds()) --> whole seconds _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1673409> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com