◐ Shell
clean mode source ↗

Avoid using floating points during timestamp-datetime conversions by hakanakyurek · Pull Request #591 · msgpack/msgpack-python

Just use 1000 instead of 1e3?

same as the previous comment, I just though "10**x" or "1ex" was the convention that was being used.

I prefer // over round.

Consider "12:34:56.78". It is "12:34" or "12:34:56", not "12:35" nor "12:34:57".

I'm not actually knowledgeable about whether there should be a round or not. The idea I had with the round is when working with a timestamp with nanosecond precision, lets say, "100,000,900" nanoseconds, I thought it should round to "100,001" microseconds, whereas "100,000,100" nanoseconds should be "100,000" microseconds.

With the case "12:34:56.78", I'm not sure whether it should "12:34:56" or "12:34:57", if rounding isn't the norm in these cases, we should definitely remove it and the tests related to it.