-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add "u" prefix to remaining standard modules? #7499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @dlech -- I am in favour of this, but I think it would be first really good to define exactly the rules for naming (and documenting) modules. Some relevant history in #6164 (sys -> usys) and #4370 (array -> uarray). Note that not all ports have weak links, so this would technically be a breaking change on those ports, but this wasn't considered a blocker for usys. I know @dlech knows all this but just for completeness for anyone else reading this, the "u" prefix achieves two related but independent things:
I think In terms of other Python standard libraries that MicroPython implements, the only other one that springs to mind is on the Unix port we also have We should aim to clear up the non-standard built-in libraries too, but that can be discussed in a separate issue. (i.e. should The other thing I'd like to address is documentation. I would imagine that most users don't care about the |
It does look a little weird, but I think it is better than having a special case for weak links.
I actually favor the opposite. This stems from the case where Also, considering the case of IDE tooling, always using In the case where people want to write code that runs on both MicroPython and standard Python, then enabling weak links and just importing |
Most MicroPython modules with the same name as a Python standard library module have the "u" prefix. This changes `math` and `cmath` to to follow this pattern. Issue: micropython#7499 Signed-off-by: David Lechner <david@pybricks.com>
Most MicroPython modules with the same name as a Python standard library module have the "u" prefix. This changes `math` and `cmath` to to follow this pattern. Issue: micropython#7499 Signed-off-by: David Lechner <david@pybricks.com>
Most MicroPython modules with the same name as a Python standard library module have the "u" prefix. This changes `math` and `cmath` to to follow this pattern. Issue: micropython#7499 Signed-off-by: David Lechner <david@pybricks.com>
Most MicroPython modules with the same name as a Python standard library module have the "u" prefix. This changes `math` and `cmath` to to follow this pattern. Issue: micropython#7499 Signed-off-by: David Lechner <david@pybricks.com>
Use composite action for fetching submodules
Most MicroPython modules that implement subsets of standard Python modules start with "u". There are a few that still don't follow this pattern:
It would be nice to change these as well. My motivation is to be able to use Python tools (like code completion in an IDE) with MicroPython. Many of these tools require actually importing modules, so it breaks things if we have module that have the same name as standard library modules.
Any objections? Did I miss any?
The text was updated successfully, but these errors were encountered: