-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
docs: Replace "umodule" with "module" everywhere. #5377
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
Conversation
Last I checked (a while ago), the Unix port did not have aliases for <module> --> <umodule> |
This was implemented in #5241 The existing weak links system (used on STM32/ESP32/ESP8266) was replaced with an automatic rule to alias foo to ufoo if it exists (now enabled on most ports). |
Okay then. =) |
completly agree with the arguments, +1. And after all we do have a „micro“ - in „micropython“ (or „upy“) so we still have the „u“ 😉. I just wished upy would have been chosen rather than mpy. |
Has there been any discussion about moving non-standard APIs out of modules that share a name with CPython? Managing filesystems (http://docs.micropython.org/en/latest/library/uos.html?highlight=uos#filesystem-mounting) is one example. In CircuitPython, we moved these APIs to a separate |
There was some related discussion about a "storage" module in #4772 (comment) I do understand the arguments for doing this, moving non-CPython stuff out of CPython-named modules. But it's not easy. For example, what about Moving all the uPy-specific filesystem stuff out of |
For learnability and aesthetics perspective, simplifying namespaces is a big +1. As Jimmo mention and as instructor myself, using "module" everywhere instead of "umodule" is important while teaching Python. For example, a bicycle is not expected to acelerate as much as an airplane, but the aceleration concept is the same regardless of the name. Compatibility wise, it isn't a particularly pleasant experience to have to wrap code in try/except blocks for obvious namespaces just to 'teach' the computer where to find the functionality people need, making code much harder to read, write, and reason about. |
This is a simple rename of the files, no content changes (other than updating index.rst to use the new paths) Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Anywhere a module is mentioned, use it's "non-u" name for consistency. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Adds section about extending built-in modules from Python. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #5377 +/- ##
==========================================
- Coverage 98.30% 98.29% -0.02%
==========================================
Files 154 154
Lines 20014 20014
==========================================
- Hits 19675 19673 -2
- Misses 339 341 +2
Continue to review full report at Codecov.
|
I have rebased this and sorted out the manual fixups. Also a bit of a reword of the overview in The two remaining u-libraries mentioned in the docs are One thing I just realised is that we're now going to break any existing docs links to the
|
I should be able to do this on the server side. |
It's weak links all the way down :) Thanks, sounds perfect. |
The "import module" vs "import umodule" is something of a FAQ, and it comes up on the forum and when I'm teaching MicroPython in-person.
In summary -- my experience has been that most people don't care about the subtle distinction between "uos" and "os". I understand and agree with the argument that the "u" is a reminder that it's the "micro" version, but I don't think it outweighs the confusion. It's one of the first things that you see in the documentation, but I don't think it's one of the first things you need to know as a beginner MicroPython programmer. Your existing Python code should just work, and the MicroPython documentation should match the idiomatic way to write code.
I think since #5241 was merged, we're in quite a good situation:
This PR updates the documentation such that:
Note: the replacements were done with a quick script, so they aren't perfect and will need some manual fixups (e.g. I can see that the very first diff is "requests" which should probably be still "urequests"...). But before I do the manual cleanup, I'd like to get some feedback on whether people think this is a worthwhile change.
Refs: