3 ms·
Vaguely reminds me of a bug I thought I had in a Python sorting routine (sorting a set of database entries by date/time) - all of the tests passed until I remov
by stordoff 10y ago
Vaguely reminds me of a bug I thought I had in a Python sorting routine (sorting a set of database entries by date/time) - all of the tests passed until I removed some debug print statements, after which it ostensibly stopped sorting and just returned the original order.
I eventually realised that the routine was fine, but my test data was being generated quickly enough that time.time() (IIRC) returned identical values for all of the dummy records (with the print statements, there was just enough of a delay for there to be a few milliseconds between each one).