You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good point. I implemented this design in analogy to Python, and also because it’s simply the obvious implementation, everything else would require a convoluted workaround, and it would make it non-obvious.
In fact, we may want to revisit our no-attach policy. Yes, it’s standard in Python. But on the other hand, we attach differently than from Python (in particular, attached objects are not exported from the module), so surgically attaching modules would result in less scope leakage than what we are doing at the moment.
The main reason for me to not use attach is to make it explicit which module a certain function resides in. This, in my opinion, is so much more readable than to keep track of which functions shadow which given multiple attached objects.
Right now, if in module
a
:then
lists
b
, even though you would not want to access the module that way.A way around this would be to (in module
a
) use:Should we use this for all module-internal imports?
The text was updated successfully, but these errors were encountered: