matejcik is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

Today I Learned
in Python, `import a.b` will place a `b` attribute on `a` ... in effect inserting a global variable into `a/__init__.py`

that's moderately surprising

matejcik @matejcik

...it also turns out to be important in a low-memory environment (with micropython), because it makes it more difficult to unimport a module. sys.modules is not the only place that holds a reference

· Web · 0 · 0