Thanks for bringing this up,
pythoncoder - it was in my queue to, which is as usual backlogged.
So, I'd like to start with - if you are affected by this change (i.e. if you need to update your code for the new argument order), please add comment to this thread. We, maintainers, sometimes have a skewed outlook - seeing all the issue reports, many of which aren't directly related to MicroPython itself, but to outside matters, or answers to which can be easily found by looking at docs, it's easy to believe: "Well, nobody uses yet that non-standard function we added, let's change it". Again, that may turn out a skewed position - we miss all people who silently enjoy MicroPython and read the docs and use what's described there without any issues. So this, change is kind of experiment - don't be silent, let is know you use it (ticks_diff() in this case)
.
Otherwise, I have to say that any non-standard feature we add to MicroPython implicitly has "provisional" status and may change, just like ticks_diff() did. Rest assured that we aren't set to break anything and everything, and we have pretty good change control: all changes are discussed, and actions usually take months to collect any opinions first. Among 2 core maintainers, we also have different position: more conservative (should I say "rather conservative") by Damien and more liberal (as you guessed) by me, so we need to come to common understanding before making a change. But note that with "Micro" in MicroPython doesn't cater for accumulating all the compatibility hacks and different versions of API. So, we may need to make such changes in the future too. Beauty (of the API) requires sacrifice.
Note that now the semantics of ticks_*() is described in very detailed manner in the docs:
http://docs.micropython.org/en/latest/e ... e.ticks_ms
And to achieve compatibility with older and newer versions you just need to wrap ticks_diff() in abs():
Code: Select all
import utime
def ticks_diff(a, b):
return abs(utime.ticks_diff(a, b))
(We of course encourage to just switch to newer version when it is released.)