-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
Flux type piracy breaks REPL completions #629
Comments
Not exactly type piracy since we own the type |
It is type piracy since you don't own |
Usually the significance of type piracy is that it can change the behaviour of unrelated code. That's not generally the case when you define something like Showing a type is definitely a special case because it's used by reflection in e.g. tab completion and so will inevitably change when a package is loaded. But that's an unusual property of that function specifically. You would get breakage if you did something like define a billion methods for [Saying it's not type piracy isn't the same as saying it's not bad to do, I'm just splitting hairs between the mechanism and the end result.] |
Bump. This shows up in non-obvious places like when calculating gradient: julia> l, pb = Flux.Zygote.pullback(θ) do
loss(xs, ys)
end;
ERROR: UndefVarError: S not defined
Stacktrace:
[1] (::Type{ERROR: UndefVarError: S not defined
Stacktrace:
[1] show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Type{ERROR: UndefVarError: S not defined
Stacktrace:
[1] show(::IOContext{Base.TTY}, ::Type{
SYSTEM (REPL): showing an error caused an error
ERROR: UndefVarError: S not defined
Stacktrace:
[1] show(::IOContext{REPL.Terminals.TTYTerminal}, ::Type{
SYSTEM (REPL): caught exception of type UndefVarError while trying to handle a nested exception; giving up |
This isn't quite the same error, since it's not coming from the show method but from a perfectly non-type-piratical constructor (in the cases of it that I've seen). See FluxML/Zygote.jl#368 for that. |
@CarloLucibello this will become a non-issue once the datasets are moved out, right? Does it make sense to add a milestone tag or something remind us to close it when that happens? |
Type piracy is here:
Flux.jl/src/data/tree.jl
Lines 16 to 17 in 78876a1
The text was updated successfully, but these errors were encountered: