Status of "u" prefixed libraries. #15643
-
Hello, I am learning MicroPython development and I would like to ask for your help with understanding the state of the MicroPython u-prefixed libraries in the latest MicroPython releases. I have tried to find some information about this, but I have only been able to find two useful pieces of information One being a short paragraph in the MicroPython docs where the future removal of "u" prefixed modules was mentioned in the context of forcing MicroPython compatible/specific ports of the modules. The second one was this Github post https://github.com/orgs/micropython/discussions/12078 . I would like to ask for your help understanding the following: I am working with an ESP32 S2. If I use asyncio and uasyncio is there any difference in the actual module I am importing, or am I importing the same code just under a different module name? And is there any other reason to still use the u-prefixed libraries or should I just use non "u" versions everywhere? The reason I am asking is that I see Peter Hinch mixing asyncio and utime imports in his primitives , it made me wonder whether there is still a benefit in doing that. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Indeed in both cases you are importing the same code You can / should use the non-prefixed libraries in almost all cases. This also allows a better portability of modules between MicroPython and CPyhon. There may be some cases however where there is benefit to be able to differentiate between the platforms , and the methods available, such as |
Beta Was this translation helpful? Give feedback.
Indeed in both cases you are importing the same code
You can / should use the non-prefixed libraries in almost all cases. This also allows a better portability of modules between MicroPython and CPyhon.
There may be some cases however where there is benefit to be able to differentiate between the platforms , and the methods available, such as
time.sleep_ms
.