-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: make default module-prefix showing independent of the state of Main(e) #29466
base: master
Are you sure you want to change the base?
Conversation
@@ -446,6 +446,9 @@ function isvisible(sym::Symbol, parent::Module, from::Module) | |||
isdefined(from, sym) # if we're going to return true, force binding resolution | |||
end | |||
|
|||
module HasOnlyDefaultImports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever!
Makes sense. Can you confirm it won't affect e.g. the output of doctests in Documenter manuals? |
Documenter will have to be updated to pass the |
This change had the advantage of making long spellings of names that are available at the REPL much shorter, which this PR does away with. Have you actually encountered people being really confused by this or is th is more of a theoretical concern? I have not personally found that people are confused by the fact that what’s available in the current session affects how things are displayed in that session. |
This is not supposed to affect how things are displayed --- that can be retained by having the REPL set the |
I agree with this principle. Seems likely to be breaking, though; perhaps |
Yes, this will probably break some package tests. One major cause I've found so far is calls to |
Right, I see what you're getting at and wholeheartedly agree that this printing shouldn't change based on what's imported into an unrelated module. I think this can be fairly legitimately argued to be a bug fix, albeit one which may cause some breakage. We'll have to be sure the breakage is fixed. |
Next major hazard: |
Likely story |
Triage notes that triage two weeks ago talked about this extensively and then wrote nothing down. Way to go triage from two weeks ago! |
Could https://discourse.julialang.org/t/making-code-available-to-workers/71462 be related to this? I mean, would something like this also make |
Currently, whether module prefixes are included in type name representations depends on what you have
using
'd in Main. This is not good. For example:In other words, behavior of code in some random place depends on what you happen to have loaded in your session. The idea behind this (more concise object representations at the REPL) makes sense, but I believe it should be implemented by setting the
:module
IOContext variable instead of by making Main the default.With this change, both outputs above are
"Sockets.IPv4"
, but the type is still shown as justIPv4
in the REPL.